フィボナッチ数列を出力するJavaScript
<script type="text/javascript"> var fib='0\n'; fib+='1\n'; for(var i=0, before=0, tmp, after=1; i<50;i++){ fib+=(before+after)+'\n'; tmp=after; after+=before; before=tmp; } document.writeln(fib); </script>