3 ms·
How to do it: for(i=0;i<a.length;i++) { b[i] = a[i] + 10 } Define your wish: b = a.map(x => x + 10) But things get muddy because many languages offer high
by k__ 5y ago
How to do it:
for(i=0;i<a.length;i++) {
b[i] = a[i] + 10
}
Define your wish:
b = a.map(x => x + 10)
But things get muddy because many languages offer higher level for-loops and forEach functions, etc.