size.js 263 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 define(['./_isArrayLike', './keys'], function (_isArrayLike, keys) { // Return the number of elements in a collection. function size(obj) { if (obj == null) return 0; return _isArrayLike(obj) ? obj.length : keys(obj).length; } return size; });