Created
May 8, 2018 11:25
-
-
Save cristianoliveira/3f72bd9fc8ac196bf3c5cffd5c669cb7 to your computer and use it in GitHub Desktop.
Test Perfomance
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
function fibCreate() { | |
return function fibonacci(num) { | |
if (num <= 1) return 1; | |
return fibonacci(num - 1) + fibonacci(num - 2); | |
}; | |
} | |
for (var i = 0, len = 40; i < len; i++) { | |
fibCreate()(i); | |
} |
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
function fibonacci(num) { | |
if (num <= 1) return 1; | |
return fibonacci(num - 1) + fibonacci(num - 2); | |
} | |
for (var i = 0, len = 40; i < len; i++) { | |
fibonacci(i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment