I have a javascript object , and I would like to count the number of records in this object. I tried length and size, but I do not get the bill.
An object
var person = new Object();
person.name = null;
person.age = null;
person.gender = null;
Then I populate this object with the following data:
person.name = 'John';
person.age = 20;
person.gender = 'M';
person.name = 'Smith';
person.age = 22;
person.gender = 'M';
I would like to return a counter with two rows of data.
source
share