JSFiddle - React, Tailwind, and code Playground

by Sunny SM

JavaScript

const isEmpty = (obj) => {
  for(var key in obj) {
    if(obj.hasOwnProperty(key))
      return false;
  }
  return true;
}
var myObj = {}

if(isEmpty(myObj)) {
    alert('Its empty');
} else {
    alert('Its not empty');
}