IE从哪个版本开始支持Object.create(null)?
在JavaScript中创建对象有很多种方法:
// 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)
方法?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查维基百科的 JavaScript 版本历史记录。如果您找到 1.8.5 版本 - 并且这是您找到此对象工厂方法可用的语言版本 - Internet Explorer 的第 9 版就是支持该版本的版本。
ECMAScript 5 兼容性表也包含此信息。
您还可以使用 Microsoft 的 IE 虚拟机之一亲自尝试(可从此处 或者,对于非常旧版本的 IE,多个 IE。
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.