Skip to content

Instantly share code, notes, and snippets.

@haru01
Created October 27, 2019 04:26
Show Gist options
  • Save haru01/fb59b5a211f7c89ef6e7e6ce11167ea9 to your computer and use it in GitHub Desktop.
Save haru01/fb59b5a211f7c89ef6e7e6ce11167ea9 to your computer and use it in GitHub Desktop.
let result = 0;
[1,2,3,4,5,6].forEach((n) => {
if (n % 2 === 0) {
result += n * n;
}
});
console.log(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment