简体   繁体   中英

check if any column in JSON object is undefined/null/empty

I'm new, but did run a search that yielded no results on this topic. Is there any way to check a JSON object for blanks?

Like if(json[randomInt()].hasBlanks) or something to that effect? Or do I have to ask for each column manually?

There are no columns in JSON. It's a document format not a table format. That means that every entry ("row") in an array can have any fields. Field names in one array entry can be completely different from the previous or any other. So in that sense, no, such a function does not exist. You would have to write it yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM