1.1.3 • Published 5 years ago
javascript-length v1.1.3
Usage
const { get } = require('javascript-length');
Length function
Length function can accept any data type of javascript except functions, null, undefined.
console.log(get.Length('Hello World', 1234)); Output 15
StrLength function
StrLength function can only accept string data type of javascript.
console.log(get.StrLength('Hello World')); Output 11
NumLength function
NumLength function can only accept number data type of javascript.
console.log(get.NumLength(123456)); Output 6
ArrLength function
ArrLength function can only accept array data type of javascript.
const arr = 1,2,3,4,5; console.log(get.ArrLength(arr)); Output 5
ObjLength function
ObjLength function can only accept object data type of javascript.
const obj = {name: 'name'}; console.log(get.ObjLength(obj)) Output 4