我正在做codeacademy教程,我真的很困惑为什么我的代码下面打印结果两次:
var getReview = function (movie) {
switch(movie){
case 'Toy Story 2':
console.log("Great story. Mean prospector.");
break;
case 'Finding Nemo':
console.log("Cool animation, and funny turtles.");
break;
case 'The Lion King':
console.log("Great songs.");
break;
default:
console.log("I don't know!");
}
};
getReview("Toy Story 2");
此代码正在打印:
Great story. Mean prospector.
Great story. Mean prospector.
你能帮助我,我想知道为什么好几天了。 :(
先谢谢。