Skip to content

Instantly share code, notes, and snippets.

@pavel-lens
Last active January 3, 2017 18:20
Show Gist options
  • Save pavel-lens/499c2a1f2f56c8dcb564f19491ca3e2f to your computer and use it in GitHub Desktop.
Save pavel-lens/499c2a1f2f56c8dcb564f19491ca3e2f to your computer and use it in GitHub Desktop.
Imperative-style programming in Javascript
const array = [1, 2, 3, 4, 5];
for (let i=0; i < array.length; i++) {
array[i] = array[i] * 2;
}
console.log(array); // [ 2, 4, 6, 8, 10 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment