can't read Element.prototype in firefox

后端 未结 3 1882
死守一世寂寞
死守一世寂寞 2021-01-03 09:14

If I run this javascript:

var a,b=Element.prototype;
for(a in b)b[a];

Firefox gives me this error:

TypeError: Value does no         


        
3条回答
  •  旧时难觅i
    2021-01-03 09:56

    You might want to try using Object.getOwnPropertyDescriptor() in your loop instead of accessing each property directly using the key on the prototype: http://codepen.io/seraphzz/pen/aJgcr

提交回复
热议问题