Skip to content

Instantly share code, notes, and snippets.

@debbysa
Created March 1, 2021 04:14
Show Gist options
  • Save debbysa/55e98ba0183212b9e0b7289565f46152 to your computer and use it in GitHub Desktop.
Save debbysa/55e98ba0183212b9e0b7289565f46152 to your computer and use it in GitHub Desktop.
var numbers = [10, 20, 30, 40];
var sum = numbers.reduce((acc, current) => acc + current, 0);
console.log(sum); // hasilnya 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment