how to check if a object is null in js code example Example: es6 check if the object is empty Object.entries(objectToCheck).length === 0