JavaScript Is or isNot

读书笔记,简化代码--不对外公布,只是做笔记使用。

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); 
 
 
原文地址:https://www.cnblogs.com/shidengyun/p/5047229.html