Created
September 21, 2017 21:48
-
-
Save matinkaboli/3298b5768eaaefde4b6658fc0e0b7924 to your computer and use it in GitHub Desktop.
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
let arrSq = []; | |
let arrSum = []; | |
for (let i = 1; i <= 100; i++) { | |
arrSq.push(i * i); | |
} | |
for (let i = 0; i <= 100; i++) { | |
arrSum.push(i); | |
} | |
arrSum = arrSum.reduce((a, b) => a + b); | |
arrSum *= arrSum; | |
arrSq = arrSq.reduce((a, b) => a + b); | |
console.log(arrSum - arrSq); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment