0
Againđ!...my qn is simple
I need a code that gets the products of the elements in r1 or r2 and it should be placed in a1 or a2 respectively Please help me out https://code.sololearn.com/cAH9WgUuPYr7/?ref=app
1 Answer
+ 3
Using reduce method however you can loop over the items as well .
var a2=r2.reduce((item,value)=>{
return item*value;
});
console.log(a2);