How to count number of key/value pairs in JSON Object
08 Oct 2016To count the number key/value pairs in a JSON object we need to convert an array. And then we can easily count the number of element in the array which is same as the number key value pairs in the json object.
Object.keys()
returns an array whose elements are strings corresponding to the enumerable properties found in the object.