codecademy javascript 数学

codecademy javascript math

我正在尝试在 codecademy 上完成以下内容:

补全缺失的代码位以构造if/else语句。使条件评估为真。 通过将字符串 "Error Error Error" 打印到控制台来完成 else 语句。

我输入了这个:

 if ("Jon".length * 2 / (2 + 1) === 2) {
   console.log("true");
 } else {
   console.log("Error Error Error");
 }

我很迷茫,很恼火,求助!

但它告诉我:哎呀,再试一次。确保您的 if/else 语句计算结果为真!

Codecademy,有很多不同的练习,你不能只通过它们,所以很容易。

最常见的问题: 语法问题 - 似乎一切正常,但可能是语法问题。

代码格式 - 例如:

通过:

 if ("Jon".length * 2 / (2 + 1) === 2) {
   console.log("true");
 } else {
   console.log("Error Error Error");
 }

不会通过:

 if ("Jon".length * 2 / (2 + 1) === 2) { console.log("true");} else {
   console.log("Error Error Error");
 }

浏览器问题 - 尝试不同的浏览器,有时会有帮助。

PS。我已经做了将近 1300 次练习,而且我经常强迫这些错误。