Skip to content

Instantly share code, notes, and snippets.

@musale
Created June 1, 2017 08:47
Show Gist options
  • Save musale/b98c9516c4e93797c0769d0267b20f54 to your computer and use it in GitHub Desktop.
Save musale/b98c9516c4e93797c0769d0267b20f54 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/zenopub
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var fibonacci = []; //{1}
fibonacci[0] = 0;
fibonacci[1] = 1; //{2}
fibonacci[2] = 1; //{3}
for (var i = 3; i < 20; i++) {
fibonacci[i] = fibonacci[i - 1] + fibonacci[i - 2]; ////{4}
}
console.log(fibonacci);
</script>
<script id="jsbin-source-javascript" type="text/javascript">var fibonacci = []; //{1}
fibonacci[0] = 0;
fibonacci[1] = 1; //{2}
fibonacci[2] = 1; //{3}
for (var i = 3; i < 20; i++) {
fibonacci[i] = fibonacci[i - 1] + fibonacci[i - 2]; ////{4}
}
console.log(fibonacci);</script></body>
</html>
var fibonacci = []; //{1}
fibonacci[0] = 0;
fibonacci[1] = 1; //{2}
fibonacci[2] = 1; //{3}
for (var i = 3; i < 20; i++) {
fibonacci[i] = fibonacci[i - 1] + fibonacci[i - 2]; ////{4}
}
console.log(fibonacci);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment