javascript get length of object
snippet in javascript

javascript object length

user4622

var size = Object.keys(myObj).length;

javascript get length of object

user1875

var person={
    "first_name":"Harry",
    "last_name":"Potter",
    "age":14
};
var personSize = Object.keys(person).length; //gets number of properties (3)