I can see here that getters are not supported in IE.
How can I know if some polyfills/Babel plugins exist so I can use it in my webapp?
I can see here that getters are not supported in IE.
How can I know if some polyfills/Babel plugins exist so I can use it in my webapp?
You must be misunderstood something. On page you've mentioned it says, that getters/setters are supported starting from IE 9 (so, should be also available in IE 11). Check Browser compatibility section.
However get/set syntax is just Syntactic sugar over old Object.defineProperty(). For example:
var bValue = 38;
var o = {
get b () { return bValue; },
set b (newValue) { bValue = newValue; }
}
equals to:
var o = {}; // Creates a new object
var bValue = 38;
Object.defineProperty(o, 'b', {
get() { return bValue; },
set(newValue) { bValue = newValue; },
enumerable: true,
configurable: true
});
console.log(o.b); // 38
So, you can use that, if you really need it like that.
As Jared Smith well pointed it's technically possible to detect at runtime wether new syntax is supported by using eval
(another option would be to pass your code as a string into new Function
).
Anyway, it's not the best way of dealing with old browsers, so if you want to write your code using ES6 syntax, but be able to use it in older browsers, use tools like babel, which will transform your code properly, so it will be supported by older browsers.