length-of-array-like
v1.0.1
Published
Get the length of an array-like
Readme
length-of-array-like
Get the length of an array-like object.
Installation
npm install length-of-array-likeUsage
var len = require("length-of-array-like")
console.log(len([1, 2, 3])) // 3
console.log(len("hi")) // 2
console.log(len({length: 5})) // 5
console.log(len(function() {})) // throws error