I've an array which I got from a spreadsheet by .getValues() method:
var arr = [
[12, 123euro, 13],
[345, 432euro, 293],
]
I want to remove 'eur' by mapping like this:
var newarr = arr.map(row => row[1].replace('euro',''))
But this gives me:
[123, 432]
Rewriting the line as:
newarr = arr.map(row => [row[0], row[1].replace('euro',''), row[2])
gives me the desired newarr:
var arr = [
[12, 123euro, 13],
[345, 432euro, 293],
]
I was expecting this result from the first try. What am I missing?
123euroand432euro? Are they strings?row[1].replace('euro','').