To convert integer array to string array in JavaScript, we call the map
method.
For instance, we write
const sphValues = [1, 2, 3, 4, 5];
const mapped = sphValues.map(String);
to call map
with String
to return an array with the numbers in the sphValues
array converted to strings.