0 votes
1 view
in Web Technology by (47.8k points)

If I have a JavaScript object, say

var myObject = new Object(); 

myObject["firstname"] = "Gareth"; 

myObject["lastname"] = "Simpson"; 

myObject["age"] = 21;

is there a built-in or accepted best practice way to get the length of this object?

1 Answer

0 votes
by (107k points)

The best way to get the length of this object is to use the below-mentioned way:-


Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !