Question and answer is powered by AnsPress.io
var obj= new Object(); obj["firstname"] = "Ujjal"; obj["lastname"] = "Koley"; obj["age"] = 30; obj["country"] = "India";
How can I find out the object length?
var obj= new Object(); obj[“firstname”] = “Ujjal”; obj[“lastname”] = “Koley”; obj[“age”] = 30; obj[“country”] = “India”; Use this to get length. var length = Object.keys(obj).length; console.log(length);