+ 1
How to increase, Please, read below.
How to increase all items in Array by variable. for eaxample, var increase = 4; var array = [12, 34, 10, 19]; if we solve the problem to it, it will output: [16, 38, 14, 23] please, Could you try to solve the problem.
5 odpowiedzi
+ 2
//Use for loop
var increase = 4;
var array = [12, 34, 10, 19];
For(i=0i<array.length;i++){
array[i]+=4
}
Console.log(array)
//You will get your expected output
+ 4
Show your code
0
Ok it's very simple use a for loop and add 4 and reassign them to their original position
Ex : array[0] += 4
0
Nice