to-length

Converts value to an integer suitable for use as the length of an array-like object.

Browse on unpkg