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
For arrays, provide a way to get more, than one argument in on iteration.
letarray=[1,2,3,4];// values onlyforeach(array,2,// step by two(a,b)=>{// 1, 2, then next will be 3, 4console.log(a,b);});// values with indicesforeach(array,2,// step by two(ai,av,bi,bv)=>{// '0 : 1, 1 : 2', then next will be '2 : 3, 3 : 4'console.log(`${ai} : ${av}, ${bi} : ${bv}`);});