javascript - "TypeError: undefined is not a function" -


i'm learning js on codecademy , i'm stuck in "switch" element part.

the instructions are: "create own switch statement in editor. can like! make sure include @ least 3 cases , default."

i "typeerror: undefined not function" i'm sure it's dumb can't figure out , tried searching no luck either.

and here's code:

// write code below!  var console = prompt("what's favorite console?");  switch(console) {      case "ps4":          console.log("it's favorite too!");          break;      case 'xone':          console.log("good choice!");          break;      case 'wii':          console.log("i don't it.");          break;      default:          console.log("that's not current gen console!");  };

you're redefining console in first line.

console used to, example, print messages. solution problem rename:

var console = ... 

to differente name:

var choice = ... 

hope helps!


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -