diff options
author | Kyle K <kylek389@gmail.com> | 2013-06-25 11:55:36 -0500 |
---|---|---|
committer | Kyle Kaminski <kyle@kkaminsk.com> | 2013-06-25 11:55:36 -0500 |
commit | ed2b003ea059d7c6a62ee3e35bc3c6d3ce73da8b (patch) | |
tree | d5b3e45f6e934b5b30854af653f61b86312ce7f4 /linkedlist.js | |
parent | b0f6fe9338c5d0da445bfe7258fc0f68b54adb24 (diff) | |
download | jsexamples-ed2b003ea059d7c6a62ee3e35bc3c6d3ce73da8b.tar.gz jsexamples-ed2b003ea059d7c6a62ee3e35bc3c6d3ce73da8b.tar.bz2 jsexamples-ed2b003ea059d7c6a62ee3e35bc3c6d3ce73da8b.zip |
remove incorrect assignment
definition of funtion Node was improperly declared due to an assignment
where a prototype object was overwritten and unwanted inheritance took
place
Diffstat (limited to 'linkedlist.js')
-rw-r--r-- | linkedlist.js | 6 |
1 files changed, 5 insertions, 1 deletions
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(); })(); |