javascript - Codecademy 控制台坏了?

标签 javascript console

我正在 Codeacademy.com 工作。控制台不会通过它。我联系了他们,但有人发现我的代码有什么问题吗?

第 4/7 节,问题 5。“故事升温。”

console.log("Batman glares at you.");
var userAnswer = prompt("Are you feeling lucky, punk!?", "");
if(userAnswer.toLowerCase() === "yes"){
    console.log("Batman hits you very hard");
} 
else{
    console.log("You did not say yes to feeling lucky.");
}

链接教程: http://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0/5?curriculum_id=506324b3a7dffd00020bf661#

最佳答案

试试这个


//Check if the user is ready to play!
confirm("Are you ready?");

var age=prompt("How old are you?");

if (age>17){
console.log("play on");
}
else
{
console.log("i don't care");
}
//Story
console.log("Snow White and Batman were hanging out at the bus stop, waiting to go to the shops. There was a sale on and both needed some new threads. You've never really liked Batman. You walk up to him.");
console.log("Batman glares at you");

var userAnswer;
var userAnswer=prompt;
prompt("are you feeling lucky?");
if (prompt==="yes")
console.log("Batman hits you very hard. It's Batman and you're you! Of course Batman wins!");
else
console.log("You did not say yes to feeling lucky. Good choice! You are a winner in the game of not getting beaten up by Batman.");

关于javascript - Codecademy 控制台坏了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18682054/

相关文章:

c# - 如何确定 Console.Out 是否已重定向到文件?

java - 频繁更新控制台时回车 '\r'不可靠

javascript - 截取浏览器页面中容器的屏幕截图

javascript - 重新加载具有相同内容的 div

python - 有没有办法在PyCharm控制台中查看参数信息?

java - 为什么在循环中进行计算会减慢将打印写入控制台但不会减慢写入文件的速度?

java - 如何在 Java 中创建命令行(控制台)

javascript - Jquery 在点击时动态创建 HTML div

javascript - 需要 Jquery 帮助 - 无限循环?

javascript - 开 Jest 测试,在第一次调用时调用实际实现,模拟其余部分