Skip to content

Instantly share code, notes, and snippets.

@chathurawidanage
Last active November 20, 2019 21:20
Show Gist options
  • Save chathurawidanage/c78a806dfdfe3e18831656a47a561cdf to your computer and use it in GitHub Desktop.
Save chathurawidanage/c78a806dfdfe3e18831656a47a561cdf to your computer and use it in GitHub Desktop.
Iterate over javascript arrays with for loop | Performance Comparison [https://gists.cwidanage.com/2019/11/how-to-iterate-over-javascript-arrays.html]
let arr = [1,2,3];
for (let i = 0; i < arr.length; i++) {
let x = arr[i] + 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment