huluoyang / freecodecamp.cn

随着FCC中文社区的快速发展和更多小伙伴的崛起,此项目已从个人项目升级到团队项目。详情请移步:

Home Page:https://github.com/FreeCodeCampChina/freecodecamp.cn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

翻译

yi2369 opened this issue · comments

Challenge Everything Be True has an issue.
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

function every(collection, pre) {
  // Is everyone being true?
  for (var i=0;i<collection.length;i++){
    if (!collection[i][pre]){
      return false;
    }
  }
  return true;
}

every([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "male"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex");

判断谓词(第二个参数)是否对一个集合(第一个参数)的所有元素都成立。
在汉语的环境里这句话不好理解,建议改成:判断谓词(第二个参数)在集合(第一个参数)的所有元素里都有效。

感谢你的反馈。
此题的翻译是英文的直译,确实很生硬。
我已重新翻译此题。
欢迎review。

@huluoyang 建议用 Commit Message 指令来关闭对应 Issue,既方便提出人 review,又利于日后 追溯历史~

@TechQuery 不懂如何使用 Commit Message 指令来关闭对应 Issue,求指教。
是因为我没有@具体人,直接回复的原因吗?

@TechQuery 感谢分享。