I get a syntax error when I insert this particular line
pp = pp.map(x => precise(x));
into my code. No other line gets the same error, and the code runs fine without this line. Please note that I am using google scripts editor.
pp
is an array.
The function precise
is coded like this.
function precise(x) {
return Number.parseFloat(x).toPrecision(3);
}
I have isolated the code and tried it out in another online JavaScript editor, which works without a problem.
Is it a problem with Google Apps Script?
Are you sure that Google Apps Scripts is compatible with ES6 syntax such as arrow functions?
You could try changing your code to the following and see if it solves the issue:
pp = pp.map(function(x) { return precise(x) });
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments