I have this piece of JavaScript code
price = price.replace(/(.*)\./, x => x.replace(/\./g,'') + '.')
This works fine in Firefox and Chrome, however IE gives me an syntax error pointing at =>
in my code.
Is there a way to use ES6 arrow syntax in IE?
IE doesn't support ES6, so you'll have to stick with the original way of writing functions like these.
price = price.replace(/(.*)\./, function (x) {
return x.replace(/\./g, '') + '.';
});
Also, related: When will ES6 be available in IE?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With