var arr = []; arr [0] = "1 + 2 "; arr [1] = "3 ^2 "; arr [2] = "2+5 "; arr [3] = "1 +2"; var newArr = arr.map(str => `${str}=${eval(str.replace('^', '**'))}`); alert(newArr);