Is Empty
isEmpty tells you whether a value is empty.
Check if a value is empty
isEmpty returns true for:
nullandundefined- An empty string (
'') - An empty array (
[]) - An empty object (
{}) - A
Map,Set,File,BloborURLSearchParamswith nothing in it
// Beforeif ( value === null || value === undefined || value.length === 0 || Object.keys(value).length === 0) { // ...}// Afterif (isEmpty(value)) { // ...}