Fix: ReferenceError: assignment to undeclared variable i
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Sep 2014 20:57:50 +0300
changeset 92 1959a0505639
parent 91 5691aa26d0c8
child 93 c2bf15c3b80b
Fix: ReferenceError: assignment to undeclared variable i
perf.js
--- a/perf.js	Thu Sep 18 11:01:03 2014 +0300
+++ b/perf.js	Mon Sep 22 20:57:50 2014 +0300
@@ -10,7 +10,7 @@
     if (typeof n !== "number" || n < 1)
         n = 1;
     var tsFrom = new Date().getTime();
-    for (i = 0; i < n; i++)
+    for (var i = 0; i < n; i++)
         fn.call(ctx);
     var tsTo = new Date().getTime();
     console.log(msg + ": %f ms, %d u/s", tsTo-tsFrom, i/(tsTo - tsFrom)*1000);