Search

Javascript - Get object length

2014-11-16 3:21 PM
Examples
var obj = {
 "key1": value1,
 "key2": value2,
 "key3": value3
};

var length = Object.keys(obj).length;

console.log(length);

//Print
3

No comments:

Post a Comment