[关闭]
@sammffl 2016-02-26T06:59:14.000000Z 字数 89 阅读 518

hasOwnProperty

小技巧


for in

  1. for(var i in o) {
  2. //保证遍历是不深入原型链
  3. if (o.hasOwnProperty(i)) {
  4. console.log(i);
  5. }
  6. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注