Skip to content

Conversation

@agil
Copy link
Member

@agil agil commented Jul 9, 2018

No description provided.

@agil agil requested a review from tshemsedinov July 9, 2018 18:52
Copy link
Member

@tshemsedinov tshemsedinov left a comment

Choose a reason for hiding this comment

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

LGTM except minor syntax issues. Also we don't use spaces in empty lines and trailing spaces at all.


append(value) {
if (!list.head) {
list.head = Node(value)
Copy link
Member

Choose a reason for hiding this comment

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

semicolon


append(value) {
if (!list.head) {
list.head = Node(value)
Copy link
Member

Choose a reason for hiding this comment

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

semicolon

@@ -0,0 +1,64 @@

Copy link
Member

Choose a reason for hiding this comment

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

'use strict';

@@ -0,0 +1,64 @@

const Node = (value, next = null) => ({
Copy link
Member

Choose a reason for hiding this comment

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

It is not a class or prototype constructor so I'd like to use lowerCamelCase here.

list.append(4);
list.remove(3);

for (item of list) {
Copy link
Member

Choose a reason for hiding this comment

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

for (const item of list) {


// Usage

const list = LinkedList();
Copy link
Member

Choose a reason for hiding this comment

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

lowerCamelCase

next,
});

const LinkedList = () => {
Copy link
Member

Choose a reason for hiding this comment

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

lowerCamelCase

@@ -0,0 +1,66 @@

Copy link
Member

Choose a reason for hiding this comment

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

'use strict';

}
},

[Symbol.iterator]: function* () {
Copy link
Member

Choose a reason for hiding this comment

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

Use shorter syntax for generator as a class/object method:

{
  *[Symbol.iterator]() {
    // code here
  }
}

}
},

[Symbol.iterator]: function* () {
Copy link
Member

Choose a reason for hiding this comment

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

Use shorter syntax for generators.

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.

3 participants