Why is my console.log not being printed?

const rollTheDice = () => {
  // Math.random() gives us a random number from 0 up to, but not including, 1
  // We multiplied that by 6 to get a number between 0 and up to, but not including, 6
  // But since we actually wanted numbers from 1 to 6, inclusive, we added 1
    let die1 = Math.floor(Math.random()) * 6 + 1
    let die2 = Math.floor(Math.random()) * 6 + 1
    return die1 + die2

console.log(die1);

}




Hi,
you just defined your function. In order to run it, you need to invoke it (rollTheDice()).
And everything after the return statement does not run anymore, so you have to swap the console and the return.

This will always be 0. Since Math.random returns a float between 0 and .999999, Math.floor will make it 0.