FairyQueen
FairyQueen

Reputation: 2373

Is ECMAScript 5 available yet in any of the browsers?

I am wanting to experiment with some of the new ECMAScript 5 features. I would like to do some stuff similar to some code I found when googling:

var obj = {};
Object.defineProperty( obj, "value", {
  value: true,
  writable: false,
  enumerable: true,
  configurable: true
});

(function(){
  var name = "John";

  Object.defineProperty( obj, "name", {
    get: function(){ return name; },
    set: function(value){ name = value; }
  });
})();

print( obj.value )
// true

print( obj.name );
// John

obj.name = "Ted";
print( obj.name );
// Ted

Is any of this possible at all yet??

Upvotes: 6

Views: 155

Answers (1)

Chris Laplante
Chris Laplante

Reputation: 29658

Here is a great compatibility table: http://kangax.github.com/es5-compat-table/

For completeness, there are also tables for ECMA6 and non-standard features.

Upvotes: 7

Related Questions