Example 1 — Official: Array Size
Arrays use .length under the hood.
_.size([1, 2, 3]);
// → 3 How It Works
- Array-like. Lodash detects a length property.
- Read length. Three elements →
3. - Same as.
[1, 2, 3].lengthfor dense arrays. - Sparse note. Holes still count toward
length.

