I am trying to create to javascript/jquery test to check if my object is empty and cannot figure it out.
Here is the object when it has something in it:
Can create the helper function :
const isEmpty = inputObject => { return Object.keys(inputObject).length === 0; };
Can use it like:
let inputObject = {}; console.log(isEmpty(inputObject)) // true.
and
inputObject = {name: "xyz"}; console.log(isEmpty(inputObject)) // false