JSFiddle - React, Tailwind, and code Playground

JavaScript

if(!Array.isArray) {
  Array.isArray = function (vArg) {
    return Object.prototype.toString.call(vArg) === "[object Array]";
  };
}

function isEmpty(theArray) {
    return Array.isArray(theArray)    
}

var a = new Array();
var b = null;
var c = undefined;
var d = [];

alert(isEmpty(a));
alert(isEmpty(b));
alert(isEmpty(c));
alert(isEmpty(d));