js get number of keys in object

JavaScript
Object.keys(obj).length

Source

Also in JavaScript: