executeScript_sandboxed supports only ES5-level Javascript
To convert the given ES6 code snippet to ES5, you need to adjust the replaceAll
method, which is not available in ES5. Here is the converted version:
var aphone = ${thing[2]};
return aphone.replace(/ /g, '');
In this ES5 version replaceAll
method is replaced with the replace
method using a regular expression (/ /g
) to globally replace all spaces with an empty string