Over time you re-use functions over and over, so why not just lump them cleanly into a lib to make your life easier?
npm i --save @bettercorp/tools
@latest
- lite/default small Tools
@heavy
- contains MomentJS and other deps
@node
- NodeJS varient with file based tools
@web
- Web based tools - See source for copy/paste of code
import { Tools } from '@bettercorp/tools';
const Tools = require('@bettercorp/tools').Tools;
Check if an array is actually an array
Tools.isArray([]); // will return true
Tools.isArray(4); // will return false
View more here: https://tools.bsbcode.dev/