How to map array by manipulating the values in another array with JavaScript

1 Answer

0 votes
const arr = [12, 6, 1, 9 , 13, 5, 7, 19];
const marr = arr.map( n => '$' + n);

document.write(marr);



/*
run:
      
$12,$6,$1,$9,$13,$5,$7,$19 
   
*/

 



answered Nov 2, 2019 by avibootz
...