mirror of https://github.com/coolaj86/fizzbuzz.git
17 lines
283 B
JavaScript
17 lines
283 B
JavaScript
|
#!/usr/bin/env node
|
||
|
"use strict";
|
||
|
var sys = require('sys');
|
||
|
(function () {
|
||
|
var seq = [];
|
||
|
function fibonacci(a, b) {
|
||
|
seq.push(a);
|
||
|
if (a >= 100) {
|
||
|
seq.push(b);
|
||
|
return;
|
||
|
}
|
||
|
fibonacci(b, a+b);
|
||
|
}
|
||
|
fibonacci(0,1);
|
||
|
sys.print(seq.join(', ') + "\n");
|
||
|
}());
|