From which version, IE can support Object.create(null)?

跟風遠走 提交于 2019-12-07 14:47:36

问题


You can create an object in JavaScript in many ways:

// creates an object which makes the Object, prototype of data.
var data1 = new Object(); 

// Object literal notation; Object still is the prototype of data2.
var data2 = {}; 

// anotherObject is now the prototype of data3.
var data3 = Object.create(anotherObject); 

/* data3 is an object which can be verified bye typeof operator, 
   however, it now has no prototype and you can 
   build everything from scratch. */
var data3 = Object.create(null); 

But I don't know which versions of IE support the last method, i.e. Object.create(null) method?


回答1:


Check Wikipedia's JavaScript version history. If you find 1.8.5 version - and this is the language version where you find this Object factory method available - 9th version of Internet Explorer is the one supporting that.

The ECMAScript 5 Compatibility Table also has this information.

You can also try for yourself using one of Microsoft's IE virtual machines (available from here or, for very old versions of IE, Multiple IE.



来源:https://stackoverflow.com/questions/7023255/from-which-version-ie-can-support-object-createnull

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!