Get property information of an object

 Get the number of an object's own properties:

var map = {'aaa': 'aaa'};
Object.getOwnPropertyNames(map).length;     // 1

 

Check if an object has a property:

var map = {'aaa': 'aaa'};
map.hasOwnProperty('aaa');    // true

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326601615&siteId=291194637