Today's npm package: objectorarray

I am developer from India currently based in Berlin, Germany.
I am very interested in Design, though I don't design ๐ I take care of it while making my apps.
Photography, videography and having random conversation over beer are my activities of spare time. Timelapses and hyperlapses make me wonder all the time ๐
Today's npm package is objectorarray
This package can help you quickly checking if the variable is an Object or Array.
Of course there are direct and vanilla-js ways to check if any value is an object or array.
But having a centralized package to avoid writing long comparison is easier to keep the project more readable and sane.
const isObjectOrArray = require('objectorarray');
console.log(isObjectOrArray(null)) // false
console.log(isObjectOrArray(false)) // false
console.log(isObjectOrArray([])) // true
console.log(isObjectOrArray({})) // true
console.log(isObjectOrArray(() => {})) // false
console.log(isObjectOrArray(new Date)) // true
Stay tuned for tomorrow's package of the Day.



