Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js object length

var person={
    "first_name":"Harry",
    "last_name":"Potter",
    "age":14
};
var personSize = Object.keys(person).length; //gets number of properties (3) 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #object #length
ADD COMMENT
Topic
Name
3+5 =