Random Number project

Hey guys! Brand new coder here, been through a few courses and trying to work on a few things myself. I’m working on a code to generate 6 random numbers (all between 0 and 49). I can’t seem to get the randomNumber function to a) either return values to an empty winningNumbers array, or b) am lucky, its working, but can’t get it to print properly.

let lottoNumbers = {
_winningNumbers: [],
},

get winningNumbers() {
return this._winningNumbers;
}

randomNumber() {
for (number = 0; number < 6; number++) {
Math.floor(Math.random() * 49);
return this._winningNumbers;
}
}
};

const win = lottoNumbers.winningNumbers[];

console.log(win);

Any help is appreciated!

Scratch the above, this is the code that’s getting the error. Its just printing the [ ] brackets.

let lottoNumbers = {
  _winningNumbers: [],

    get winningNumbers() {
    return this._winningNumbers;
  },
  
  randomNumber() {
    for (number = 0; number < 6; number++) {
      Math.floor(Math.random() * 49);
      return this._winningNumbers;
   }
  } 
};

const win = lottoNumbers.winningNumbers;

console.log(win);

Thank you! This helps! I also got the “starting the random number at 1” problem sorted.

Thank you!