You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constnumbers=[1,2,3,4];constdoubled_oneadded=numbers.map(number=>number*2).map(number=>number+1)console.log("Numbers doubled, and has 1 added to it:",doubled_oneadded);// [ 3, 5, 7, 9 ]
constnumbers=[1,2,3,4];constsum_doubled=numbers.map(number=>number*2).reduce(((total,number)=>total+number),0);console.log("The sum of the doubled numbers is:",sum_doubled);// 20