从哪个版本,IE可以支持Object.create(null)? [英] From which version, IE can support Object.create(null)?
问题描述
您可以通过多种方式在JavaScript中创建对象:
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);
但我不知道哪个版本的IE支持最后一种方法,即 Object.create(null)
方法?
But I don't know which versions of IE support the last method, i.e. Object.create(null)
method?
推荐答案
检查维基百科的 JavaScript版本历史记录。如果您找到1.8.5版本 - 这是您可以找到此对象工厂方法的语言版本 - 第9版Internet Explorer是支持该版本的版本。
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.
ECMAScript 5兼容性表也有此信息。
您也可以尝试使用Microsoft的IE虚拟机之一(可从此处或者,对于非常旧版本的IE,多个IE 。
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.
这篇关于从哪个版本,IE可以支持Object.create(null)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!