how to count number of objects in java script code example Example: javascript get number of elements in object Object.keys(obj).length