const birthYear = 2002;
let century;
if (birthYear <= 2000)
let century = 20;
} else {
let century = 21;
}
console.log(century);
所以问题是,当我运行代码控制台说&;undefined&;。我想知道是什么问题。(我在编码和所有这些东西的新,所以,请帮助。提前感谢)
这里回答
const birthYear = 2002;
let century;
if (birthYear <= 2000) {
century = 20
} else {
century = 21
}
console.log(century)