Convert integer array to string array in JavaScript

Use Array.map:

var arr = [1,2,3,4,5];
var strArr = arr.map(function(e){return e.toString()});
console.log(strArr); //["1", "2", "3", "4", "5"] 

Edit:
Better to use arr.map(String); as @elclanrs mentioned in the comments.


for(var i = 0; i < sphValues.length; i += 1){
    sphValues[i] = '' + sphValues[i];
}

You can use map and pass the String constructor as a function, which will turn each number into a string:

sphValues.map(String) //=> ['1','2','3','4','5']

This will not mutate sphValues. It will return a new array.


just by using array methods

var sphValues = [1,2,3,4,5];   // [1,2,3,4,5] 
sphValues.join().split(',')    // ["1", "2", "3", "4", "5"]