js获取map的长度 var map={ 'key1':'value1', 'key2':'value2', 'key3':'value3' } console.log(Object.getOwnPropertyNames(map).length);