//me function solution(a, b) { var answer = 0; for(let i=0; i<a.length; i++){ answer = answer + a[i]*b[i]; } return answer; }
// best // reduce method 이용, index function solution(a, b) { return a.reduce((acc, _, i) => acc += a[i] * b[i], 0); }