size

Collection
since 0.1.0

Arguments

  • Array|Object|string The collection to inspect.

Returns

number the collection size.

Gets the size of collection by returning its length for array-like values or the number of own enumerable string keyed properties for objects.

Example of Lodash _.size

_.size([1, 2, 3]);
// => 3

_.size({ 'a': 1, 'b': 2 });
// => 2

_.size('pebbles');
// => 7