Skip to content

Instantly share code, notes, and snippets.

@tnolet
Last active January 19, 2018 07:40
Show Gist options
  • Save tnolet/9432f1f39890a22bfb9195e5adeb3eca to your computer and use it in GitHub Desktop.
Save tnolet/9432f1f39890a22bfb9195e5adeb3eca to your computer and use it in GitHub Desktop.
exports.handler = (event, context, callback) => {
for (let i=0; i<30; i++){
console.log(fib(i))
}
const result = {
"isBase64Encoded": false,
"statusCode": 200,
"headers": {},
"body": "done"
}
callback(null, result);
};
function fib(n) {
if(n > 1){
return fib(n-1) + fib(n-2)
} else {
return n;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment