diff --git a/documentation/js/array_comprehensions.js b/documentation/js/array_comprehensions.js
index 636ccb49..edc73121 100644
--- a/documentation/js/array_comprehensions.js
+++ b/documentation/js/array_comprehensions.js
@@ -1,20 +1,24 @@
(function(){
- var __a, __b, __c, __d, __e, __f, __g, __h, food, i, lunch, row;
+ var __a, __b, __c, __d, __e, __f, __g, food, i, lunch, row;
// Eat lunch.
__a = ['toast', 'cheese', 'wine'];
- __d = [];
- for (__b=0, __c=__a.length; __b<__c; __b++) {
- food = __a[__b];
- __d[__b] = food.eat();
+ __c = [];
+ for (__b in __a) {
+ if (__a.hasOwnProperty(__b)) {
+ food = __a[__b];
+ __d = food.eat();
+ __c.push(__d);
+ }
}
- lunch = __d;
+ lunch = __c;
// Zebra-stripe a table.
__e = table;
- __h = [];
- for (__f=0, __g=__e.length; __f<__g; __f++) {
- row = __e[__f];
- i = __f;
- __h[__f] = i % 2 === 0 ? highlight(row) : null;
+ __f = [];
+ for (i in __e) {
+ if (__e.hasOwnProperty(i)) {
+ row = __e[i];
+ i % 2 === 0 ? highlight(row) : null;
+ }
}
- __h;
+ __f;
})();
\ No newline at end of file
diff --git a/documentation/js/overview.js b/documentation/js/overview.js
index dbcd550d..36379ca7 100644
--- a/documentation/js/overview.js
+++ b/documentation/js/overview.js
@@ -23,10 +23,13 @@
};
// Array comprehensions:
__a = list;
- __d = [];
- for (__b=0, __c=__a.length; __b<__c; __b++) {
- num = __a[__b];
- __d[__b] = math.cube(num);
+ __c = [];
+ for (__b in __a) {
+ if (__a.hasOwnProperty(__b)) {
+ num = __a[__b];
+ __d = math.cube(num);
+ __c.push(__d);
+ }
}
- cubed_list = __d;
+ cubed_list = __c;
})();
\ No newline at end of file
diff --git a/documentation/js/scope.js b/documentation/js/scope.js
index 23b0c8e9..38d5e939 100644
--- a/documentation/js/scope.js
+++ b/documentation/js/scope.js
@@ -4,7 +4,7 @@
change_numbers = function change_numbers() {
var new_num;
num = 2;
- return (new_num = 3);
+return (new_num = 3);
};
new_num = change_numbers();
})();
\ No newline at end of file
diff --git a/documentation/js/super.js b/documentation/js/super.js
index 11135d23..040d6d2e 100644
--- a/documentation/js/super.js
+++ b/documentation/js/super.js
@@ -6,7 +6,7 @@
return alert(this.name + " moved " + meters + "m.");
};
Snake = function Snake(name) {
- return (this.name = name);
+return (this.name = name);
};
Snake.__superClass__ = Animal.prototype;
Snake.prototype = new Animal();
@@ -16,7 +16,7 @@
return Snake.__superClass__.move.call(this, 5);
};
Horse = function Horse(name) {
- return (this.name = name);
+return (this.name = name);
};
Horse.__superClass__ = Animal.prototype;
Horse.prototype = new Animal();
diff --git a/index.html b/index.html
index c413e81b..55c4e961 100644
--- a/index.html
+++ b/index.html
@@ -111,12 +111,15 @@ math = {
};
// Array comprehensions:
__a = list;
-__d = [];
-for (__b=0, __c=__a.length; __b<__c; __b++) {
- num = __a[__b];
- __d[__b] = math.cube(num);
+__c = [];
+for (__b in __a) {
+ if (__a.hasOwnProperty(__b)) {
+ num = __a[__b];
+ __d = math.cube(num);
+ __c.push(__d);
+ }
}
-cubed_list = __d;
+cubed_list = __c;
Installation and Usage
@@ -373,7 +379,7 @@ num =1;
change_numbers =functionchange_numbers() {
var new_num;
num =2;
- return (new_num =3);
+return (new_num =3);
};
new_num = change_numbers();
@@ -579,24 +585,28 @@ lunch: food.eat() for# Zebra-stripe a table.
highlight(row) for row, i in table when i %2is0
-
var __a, __b, __c, __d, __e, __f, __g, __h, food, i, lunch, row;
+