summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--keyval-assignment.js4
-rw-r--r--linkedlist.js6
2 files changed, 7 insertions, 3 deletions
diff --git a/keyval-assignment.js b/keyval-assignment.js
index c4b491f..d64fdd3 100644
--- a/keyval-assignment.js
+++ b/keyval-assignment.js
@@ -16,10 +16,10 @@ console.log(foo['val3']);
var bar = new Object();
bar.foo = function() {};
-bar.foo.val1 = 99;
+bar.foo.val1 = 99; // will get overwritten
bar.foo = {
val2: 3.14,
val3: 121
};
-console.log(bar.foo['val2']); \ No newline at end of file
+console.log(bar.foo['val2']);
diff --git a/linkedlist.js b/linkedlist.js
index acae6d9..8b3f23e 100644
--- a/linkedlist.js
+++ b/linkedlist.js
@@ -11,7 +11,6 @@
};
LinkedList.Node = function() {}
- LinkedList.Node.prototype = new LinkedList();
LinkedList.Node.prototype = {
val: null,
prev: null,
@@ -51,7 +50,12 @@
}
var ll = new LinkedList();
+ var ll2 = new LinkedList();
ll.add(7).add(12).add(13).add(21);
ll.print();
ll.size();
+
+ ll2.add(70).add(120).add(130);
+ ll2.print();
+ ll2.size();
})();