Counting number of properties in a JS object
In Javascript | 1 CommentWhen there is a JS array, it is easy to count the number of elements. For example: var arr = [“hello”, “world”]; console.log(arr.length); // 2 However, when you have an object it is a bit more tricky. .length wont work. One way is to iterate…