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
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