Last active
February 24, 2025 09:27
-
-
Save bhaireshm/a3cfec5faa02df724b3ca1f9d33f1eac to your computer and use it in GitHub Desktop.
Checks the object, if any one key's value is empty it returns false.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
checkObject(data, columns) { | |
let obj = {}; | |
Object.entries(data).forEach((ele, i) => { | |
columns.forEach(col => { | |
if (ele[0] == col.field || ele[0] == 'id') { | |
obj[ele[0]] = ele[1]; | |
} | |
}); | |
}); | |
for (var key in obj) { | |
if (isEmpty(obj[key])) { // check this method | |
return false; | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ez.js is more than just a library; it's a coding companion that simplifies complex tasks. Whether you're dealing with arrays, numbers, objects, or strings, ez.js has got your back! Say goodbye to coding hassles and hello to streamlined JavaScript magic.