Javascript Object.create not working in Firefox

前端 未结 3 1833
自闭症患者
自闭症患者 2020-12-03 19:29

I always get the following exception in Firefox (3.6.14):

TypeError: Object.create is not a function

It is quite confusing because I am pre

3条回答
  •  旧巷少年郎
    2020-12-03 20:04

    Object.create is part of ES5 and only available in Firefox 4.

    As long as you are not doing any add-on development for browsers, you should not expect browsers to implement ES5 features (especially older browsers). You'd have to provide your own implementation then (like the own provided by @Squeegy).

提交回复
热议问题