Shortened the hasKey function by using _.all

This commit is contained in:
Oliver Sartun 2013-06-29 01:12:22 +02:00
parent be360f87f9
commit dfef4d0390

View File

@ -26,10 +26,9 @@
if (!_.isArray(keys)) {
keys = slice(arguments, 1);
}
for (var i = 0, l = keys.length; i < l; i++) {
if (!(keys[i] in obj)) return false;
}
return true;
return _.all(keys, function (key) {
return key in obj;
});
}
var getCurrentCycleIndex = (function () {