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

文字描述错误

Open cxmSevenlaps opened this issue 10 years ago • 2 comments

Challenge Comparisons with the Logical Or Operator has an issue. User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

“只有当num大于等于5或小于等于10时,函数返回"Yes"。”这句话中的描述应该是:num小于等于5或者大于等于10.

if (num > 10 || num < 5) { return "No"; } return "Yes";

cxmSevenlaps avatar Nov 04 '16 01:11 cxmSevenlaps

请仔细看代码逻辑

discountry avatar Nov 04 '16 14:11 discountry

這題文字教學怎麼看起來怪怪的

只有当num大于等于5或小于等于10时,函数返回"Yes"。相同的逻辑可以简写成: if (num > 10 || num < 5) { return "No"; } return "Yes";

應該要說成 只有当num大于等于5"而且"小于等于10时,函数返回"Yes" 才能跟舉例的判斷式吻合

AzhengTsai avatar Apr 15 '17 13:04 AzhengTsai