I like to group all type checking tasks into helper functions like this to be used internally. This has the advantage in case of code minification.
These functions are very inspired by PHP which already has standard functions such as is_array()
, is_object()
, is_string()
, etc.
const {isString} = require('@taufik-nurrohman/is');
console.log(isString('false'));
import {isString} from '@taufik-nurrohman/is';
console.log(isString('false'));