Skip to content

Instantly share code, notes, and snippets.

@ekrem-aktas
Created September 24, 2020 12:16
Show Gist options
  • Save ekrem-aktas/173b171ffd43c0576e8d86e889135c27 to your computer and use it in GitHub Desktop.
Save ekrem-aktas/173b171ffd43c0576e8d86e889135c27 to your computer and use it in GitHub Desktop.
const numbers = [1, 2, 3];
let total = 0;
numbers.forEach(num => total += num);
console.log(total) // 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment