JSFiddle - React, Tailwind, and code Playground

by Trần Ngọc Minh

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