my-idlers/node_modules/collect.js/dist/methods/count.js

11 lines
218 B
JavaScript
Raw Normal View History

'use strict';
module.exports = function count() {
var arrayLength = 0;
if (Array.isArray(this.items)) {
arrayLength = this.items.length;
}
return Math.max(Object.keys(this.items).length, arrayLength);
};