Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<body>
<h2>Fibonacci sequence with For loop</h2>
<p id="demo"></p>
<script>
<!-- ten javascript se muzes presunout i sem -->
/*
var text = "";
var i;
var fib1 = 0;
var fib2 = 1;
for (i = 0; i < 20; i++) {
  var sum = fib1 + fib2;
  text += fib1 + "<br>";
  fib1 = fib2;
  fib2 = sum;
}
document.getElementById("demo").innerHTML = text;
*/
</script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers