JSFiddle - React, Tailwind, and code Playground

by elclanrs

JavaScript

var o = {};
var re = /\d/;
var f = function(){};
var d = new Date();

var isObj = function(e){
    return e.toString() === '[object Object]';
};

console.log( isObj(o) ); // True
console.log( isObj(re) ); // False
console.log( isObj(f) ); // False
console.log( isObj(d) ); // False