Last active
September 14, 2020 17:30
-
-
Save jasonleehodges/149c6a3a76458db1657eb4819b6b42c3 to your computer and use it in GitHub Desktop.
Figure 1 - Basic Accumulator Pattern
This file contains hidden or 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
const numbers: number[] = [3, 5, 7, 9, 12]; | |
let accumulator: number = 0; | |
for (let i = 0; i < numbers.length; i++) { | |
accumulator += numbers[i]; | |
} | |
// 36 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment