-
Notifications
You must be signed in to change notification settings - Fork 0
Js linked list #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
js-src/js-linked-list.js
Outdated
| iter.forEach(item => this.push(item)); | ||
| } | ||
| else if (iter !== null) { | ||
| return 'LinkedList only takes arrays as inputs.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should look up how to throw errors in Javascript
| } | ||
| } | ||
|
|
||
| display() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if your linked list contains [4] -> [5] -> [6] this will display (4,5,6,). Handle that trailing comma
No description provided.