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 a syntax error pointing to =>in my code.
=>
Is there a way to use ES6 arrow syntax in IE?
IE does not support ES6, so you have to stick with the original way of writing such functions.
price = price.replace(/(.*)\./, function (x) { return x.replace(/\./g, '') + '.'; });
Also related: When will ES6 be available in IE?
Internet explorer . , .
- :
price = price.replace(/(.*)\./, function (x) { x.replace(/\./g,'') + '.'; }
.
Source: https://habr.com/ru/post/1658097/More articles:Angular Http не работает. Обещание смешивается с наблюдаемым подходом - httpPopulate the DataGridView with a stored procedure (which has connections) through the WCF service C # - c #Итератор должен иметь другое поведение при вызове next()/previous() для элементов - c++Hystrix programmable properties - javaFast variable declaration and initialization - swifthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1658098/how-to-replace-multiple-if-else-statements-to-optimize-code&usg=ALkJrhiLqS2ZB6Bexw18kAx-QF875h56igParse a JSON key, which is either an object or an array of an object - javaAdobe Flash in Selenium, Chrome 54.0.2840.59-1: "This plugin is not supported" - google-chromeWorkaround to return an uncovered object without moving ctor - c ++How to check if a string contains a dictionary - pythonAll Articles