Tell us what’s happening:
Describe your issue in detail here.
if let a = [45,20,64,87,96,54];
/* suppose I want to add a[i] + a[i+1] = b[i] which
is equal to (example “i=0”) a[0] + a[1] = b[0];
*how to do that with the function map instead of a for loop?
*because in the function map I don’t have a “i” variable.
const b = a.map(function(a) {
return
});
console.log(b);
**Your browser information:**
User Agent is: <code>Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36</code>