Helper to return the length value of an object, this will return the value of the "length" property. Generally used to return the length of a string or array.
The value to return the length property from, must contain a length property
length
0.4.2
getLength(""); // returns 0getLength("Hello World"); // returns 11getLength([]); // returns 0;getLength([0, 1, 2, 3]); // returns 4;getLength({ length: 42}); // returns 42getLength({ length: () => 53; }); // returns the function that if called would return 53 Copy
getLength(""); // returns 0getLength("Hello World"); // returns 11getLength([]); // returns 0;getLength([0, 1, 2, 3]); // returns 4;getLength({ length: 42}); // returns 42getLength({ length: () => 53; }); // returns the function that if called would return 53
Helper to return the length value of an object, this will return the value of the "length" property. Generally used to return the length of a string or array.