I have a JavaScript object. Is there a built-in or accepted best practice way to get the length of this object?
const myObject = new Object(); myObject["
The simplest way is like this:
Object.keys(myobject).length
Where myobject is the object of what you want the length of.