逻辑运算符


#1

不知道哪里做错了
var moonPhase = 'solar eclipse';
var foggyNight=ture;
if (moonPhase === 'full') {
console.log('Howwlll!');
} else if (moonPhase === 'mostly full') {
console.log('Arms and legs are getting hairier');
} else if (moonPhase === 'mostly new') {
console.log('Back on two feet');
} else {
console.log('Invalid moon phase');
}


#2

你的问题是什么

在这个例子中,最后一个子句将被执行 (else)

moonPhase === "solar eclipse"

没有任何条件匹配


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.