When to 'while' and when to 'for' Problem (Please Help)



I keep getting the message "rollDice is not a function." Is there something wrong with my syntax? I keep checking but I can't seem to find it.


var rollDice = [1,2,3,4,5,6];
var rollDice = true;
while (rollDice) {
console.log("Lets the roll the dice!!");
rollDice = false;
for (var i = 1; i < 7; i++) {


The error is due to this. This is a function syntax when rollDice is not a function.


Yeah, I fixed that part, but should I only be getting 1 number instead of all six?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.