Skip to content
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

Pr-7 #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Pr-7 #8

wants to merge 1 commit into from

Conversation

CheezItMan
Copy link

@CheezItMan CheezItMan commented Aug 13, 2019

No description provided.

@CheezItMan CheezItMan changed the title Node class Pr-7 Aug 13, 2019
@kaidamasaki
Copy link

kaidamasaki commented Aug 13, 2019

Why did you change the name of the PR from "Node class" to "Pr-7"?

I'd like to see "Add JavaScript Node class" once this is merged so it's clear.

while (current != null) {
console.log(current.value);
current = current.getNext();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd prefer to see this build up something like "1 -> 2 -> 3 -> null".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, Kaida. Good suggestion.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

}
}

export default Node;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing final newline.

let current = this;

while (current != null) {
console.log(current.value);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this console.log need to be here?

printList() {
let current = this;

while (current != null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be a little cleaner to say "while (current)"

Suggested change
while (current != null) {
while (current) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants