Created
August 16, 2017 05:49
-
-
Save astfarias/d1683f9fc8b84a24951cf70ce87fe16a to your computer and use it in GitHub Desktop.
JS - Functional Programming - Higher-order Functions - for
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Iterate under array to add values | |
var total = 0; | |
var numbers = [0, 1, 5, 7, 3, 8, 9, 10]; | |
for (var i = 0; i < numbers.length; i++){ | |
total += numbers[i]; | |
} | |
console.log("total ", total); | |
// 43 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment