javascript get number of elements in object

JavaScript
Object.keys(obj).length
Source

Also in JavaScript: