Beginner - Reduce but Grow

Lee·2022년 6월 28일

Algorithm

목록 보기
32/92
post-thumbnail

❓ Beginner - Reduce but Grow

Q. Given a non-empty array of integers, return the result of multiplying the values together in order. Example:

[1, 2, 3, 4] => 1 2 3 * 4 = 24

✔ Solution

function grow(x){
  return x.reduce((a,b)=> a*b);
}
profile
Lee

0개의 댓글