functionisGreeting(value) { return/^h(?:i|ello)$/.test(value); } functioncustomizer(objValue, othValue) { if (isGreeting(objValue) &&isGreeting(othValue)) { returntrue; } } vararray= ['hello', 'goodbye']; varother= ['hi', 'goodbye']; _.isEqualWith(array, other, customizer);
输出:true