Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript: Which Browsers support prototype inheritance?

Currently I'm not using prototype because I remember that a day I've read an article where it was stated that Prototype is not supported in IE 7 and down below, but I can't find that article again but by the way it would be good to know how it is supported overall.

like image 602
Adam Halasz Avatar asked Jun 13 '11 15:06

Adam Halasz


People also ask

What is prototype based inheritance in JavaScript?

The Prototypal Inheritance is a feature in javascript used to add methods and properties in objects. It is a method by which an object can inherit the properties and methods of another object. Traditionally, in order to get and set the [[Prototype]] of an object, we use Object. getPrototypeOf and Object.

Which type of inheritance is supported by JavaScript?

In JavaScript, inheritance is supported by using prototype object. Some people call it "Prototypal Inheriatance" and some people call it "Behaviour Delegation". Let's see how we can achieve inheritance like functionality in JavaScript using prototype object.

Is __ proto __ deprecated?

__proto__ is considered outdated and somewhat deprecated (moved to the so-called “Annex B” of the JavaScript standard, meant for browsers only). The modern methods to get/set a prototype are: Object.

Which object in JavaScript does not have a prototype?

Both objectOne and objectTwo are non-function objects therefore they don't have a prototype property.


1 Answers

JScript (Microsoft's interpretation of Javascript) has supported the prototype property since version 2.0 (MSDN). The first version of Internet Explorer that supported JScript 2.0 was IE 3 (MSDN).

I'd say you're safe with IE7!


Edit: perhaps you're thinking about modifying the prototypes of host objects, such as Node. This is indeed not supported by IE >=7, and is a bad idea anyway. A good article on this is at perfectionkills.com.

like image 85
lonesomeday Avatar answered Sep 24 '22 03:09

lonesomeday