JSFiddle - React, Tailwind, and code Playground
JavaScript
// tính tổng các phần tử trong mảng
var numbers = [65, 44, 12, 4];
function getSum(total, num) {
return total + num;
}
alert(numbers.reduce(getSum));//125
// tính tổng các phần tử trong mảng
var numbers = [65, 44, 12, 4];
function getSum(total, num) {
return total + num;
}
alert(numbers.reduce(getSum));//125