Version 1
[yaffs-website] / node_modules / phantomjs-prebuilt / lib / phantom / examples / fibo.js
diff --git a/node_modules/phantomjs-prebuilt/lib/phantom/examples/fibo.js b/node_modules/phantomjs-prebuilt/lib/phantom/examples/fibo.js
new file mode 100644 (file)
index 0000000..7ee472a
--- /dev/null
@@ -0,0 +1,10 @@
+"use strict";
+var fibs = [0, 1];
+var ticker = window.setInterval(function () {
+    console.log(fibs[fibs.length - 1]);
+    fibs.push(fibs[fibs.length - 1] + fibs[fibs.length - 2]);
+    if (fibs.length > 10) {
+        window.clearInterval(ticker);
+        phantom.exit();
+    }
+}, 300);