any-length

This module returns length of any type.

Usage no npm install needed!

<script type="module">
  import anyLength from 'https://cdn.skypack.dev/any-length';
</script>

README

Any Length

This module returns length of any type.

Install

Install with npm:

$ npm install --save any-length

const anyLength = require('any-length');

console.log( anyLength(123), 3 ); // return 3

console.log( anyLength("foo"), 3 ); // return 3

console.log( anyLength([ 1, 2, 3, 4, 5 ]), 5 ); // return 5

console.log( anyLength({ a: "b", c: "d" } ), 2 ); // return 2

Running tests

$ node test.js

License

Released under the MIT License.