أولا اللغة التي تعمل بها هي جافا سكريبت و ليست جاف و لا يشبهان بعضهما أبدا إلا في الإسم.
ثانيا الحل يجب أن يكون كاملا، الكود الذي كتبته صحيح لكن لم تضف له الجزء الأول ليصبح كاملا يعني الحل هو كمايلي:
كود بلغة HTML:
// Check if the user is ready to play!
confirm("I am ready to play!");
var age = prompt("What's your age");
if (age<13){
console.log("You can play, but we take no responsibility for anything");
} else {
console.log("Get ready to play!");
};
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");
var userAnswer = prompt("Do you want to race Bieber on stage?");
if (userAnswer === "yes") {
console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
} else {
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
};
يعني في حالتك يجد if واحدة فقط في حيين هو يبحث عن if الثانية فلا يجدها لذا يخرج لك رسالة تقول بأنك لم تضع if.....