Created
December 7, 2018 19:15
-
-
Save masterfermin02/9b3debe1e1cc21b46c194dcfa4ead899 to your computer and use it in GitHub Desktop.
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
function square_first_200() | |
{ | |
var result = []; | |
for(var i = 1; i <= 200; i++) | |
{ | |
result.push(i*i); | |
} | |
return result; | |
} |
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
function square_first_200_recursive(number = 200, result = []) | |
{ | |
if(number < 1) return 1; | |
square_first_200_recursive(number -1, result) | |
result.push(number * number); | |
return result; | |
} | |
// console.log(square_first_200_recursive()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment