读书笔记,简化代码--不对外公布,只是做笔记使用。 var superman = { name: "Superman", strength: "Super", heroism: true };
function isSuperStrong (character) { return character.strength === "Super"; }
function negate (predicateFunc) { return function () { return !predicateFunc.apply(this, arguments); }; }
var isNotSuperStrong = negate(isSuperStrong);
时间: 2024-11-08 22:06:52