fork download
  1. // your code goes here
  2. const soal3 = (array, value) => {
  3. let newArr = [];
  4. for (let i = 0; i < array.length; i++) {
  5. array[i] = array[i] + value;
  6. newArr.push(array[i]);
  7. }
  8. return newArr;
  9. };
  10. console.log(soal3([0, 9, 8, 7, 6, 5, 4, 3, 2, 1], 4));
Success #stdin #stdout 0.04s 16536KB
stdin
Standard input is empty
stdout
4,13,12,11,10,9,8,7,6,5