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["
If you know you don't have to worry about hasOwnProperty checks, you can do this very simply:
hasOwnProperty
Object.keys(myArray).length