![]() |
VOOZH | about |
Lodash _.size() method gets the size of the collection by returning its length for the array such as values or the number of own enumerable string keyed properties for objects.
_.size(collection);This method returns the collection size.
Example 1: In this example, we are printing the size of the given array by the use of the _.size() method.
Output:
5Example 2: In this example, we are printing the size of the given object by the use of the _.size() method.
Output:
3Example 3: In this example, we are printing the size of the given string by the use of the _.size() method.
Output:
13, 16