Practice with switch 6. TypeError: prompt is not a function


#1



`

var candy = prompt("What's your favorite candy?","Type your favorite candy here.");

switch(candy) {
case 'licorice':
console.log("Gross!");
break;
case 'gum':
console.log("I like gum!");
break;
case 'beets':
console.log("...is that even a candy?");
break;
// Add your code here!
(my code --------->)default:
console.log ("you sure its your favorite?");
};

there's an error that keeps popping up: "TypeError: prompt is not a function".
it's the website's code...
is there a fix coming up soon?
i'm pretty sure its not my code thats wrong.


#2

@microrockstar63833,
Use

switch(candy) {
 case 'licorice':
 console.log("Gross!");
 break;
 case 'gum':
 console.log("I like gum!");
 break;
 case 'beets':
 console.log("...is that even a candy?");
 break;
 // Add your code here!
default:
 console.log ("you sure its your favorite?");
};

and do a refresh Browser

++++ reset of session *****************
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom


#3

I did all of that and still dosn't work.
says: "TypeError: prompt is not a function".


#4

@microrockstar63833,
Then it probably is
you have disabled the popup....


#5

that worked! thanks!