freecodecamp.cn icon indicating copy to clipboard operation
freecodecamp.cn copied to clipboard

条件使用 12==var 也是对的,但是无法通过测试。

Open stk-tianwen opened this issue 10 years ago • 3 comments

Challenge Comparison with the Equality Operator has an issue. User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

// Setup
function myTest(val) {
  if (12 == val) { // Change this line
    return "Equal";
  }
  return "Not Equal";
}

// Change this value to test
myTest(12);

条件使用 12==var 也是对的,但是无法通过测试。

stk-tianwen avatar Nov 09 '16 09:11 stk-tianwen

建议携程val == 12 ,可读性较好。

juneybw avatar Nov 10 '16 06:11 juneybw

可以通过

discountry avatar Nov 12 '16 06:11 discountry

我这里怎么显示 最后一项(你应该使用 == 运算符)不能通过? 不能贴图。:(

stk-tianwen avatar Nov 19 '16 01:11 stk-tianwen