Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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??

like image 728
FairyQueen Avatar asked Apr 10 '12 18:04

FairyQueen


1 Answers

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.

like image 54
Chris Laplante Avatar answered Sep 28 '22 06:09

Chris Laplante