 
		hj1212
2018-02-01 18:38
for(item in mapCount1) { if(mapCount1[item] !== mapCount2[item]) return false }
 
				JS中的for...in会判断对象原型链上的所有属性,如果只是考虑对象自己的属性可以参考:
for(item in mapCount1){
  if(mapCount1.hasOwnProperty(item)){
     if(mapCount1[item] !== mapCount2[item]) 
        return false;
  }
}JavaScript深入浅出
281087 学习 · 1054 问题
相似问题