linear regression tests work without console defined
authorDan Vanderkam <danvdk@gmail.com>
Mon, 4 Oct 2010 21:47:52 +0000 (17:47 -0400)
committerDan Vanderkam <danvdk@gmail.com>
Mon, 4 Oct 2010 21:47:52 +0000 (17:47 -0400)
tests/linear-regression-addseries.html
tests/linear-regression.html

index 4445f47..183189d 100644 (file)
@@ -73,7 +73,7 @@
         var b = (sum_y - a * sum_x) / num;
 
         coeffs[series] = [b, a];
-        if (console) {
+        if (typeof(console) != 'undefined') {
           console.log("coeffs(" + series + "): [" + b + ", " + a + "]");
         }
 
index 9f18d58..03c95c2 100644 (file)
@@ -67,7 +67,7 @@
         var b = (sum_y - a * sum_x) / num;
 
         coeffs[series] = [b, a];
-        if (console) {
+        if (typeof(console) != 'undefined') {
           console.log("coeffs(" + series + "): [" + b + ", " + a + "]");
         }