Skip to content

New function 'fromArray' #125

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

Closed
wants to merge 4 commits into from
Closed

New function 'fromArray' #125

wants to merge 4 commits into from

Conversation

seIncorp
Copy link
Contributor

Function gor through array and add all nodes to linked list.

seIncorp added 3 commits July 30, 2018 15:07
Function gor through array and add all nodes to linked list.
@codecov-io
Copy link

codecov-io commented Jul 30, 2018

Codecov Report

Merging #125 into master will decrease coverage by 0.04%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #125      +/-   ##
==========================================
- Coverage     100%   99.95%   -0.05%     
==========================================
  Files         117      117              
  Lines        2283     2284       +1     
  Branches      396      396              
==========================================
  Hits         2283     2283              
- Misses          0        1       +1
Impacted Files Coverage Δ
src/data-structures/linked-list/LinkedList.js 98.57% <0%> (-1.43%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ecc8c65...7966e1f. Read the comment docs.

@trekhleb
Copy link
Owner

@seIncorp looks like test checks are failing. Could you please cover your function with tests?

/**
* @param {function} [callback]
* @return {string}
*/

Copy link
Owner

Choose a reason for hiding this comment

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

Why do we need empty line here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was miss type

*/
fromArray(arr = []) {
arr.map(node => this.append(node.value));
}
Copy link
Owner

Choose a reason for hiding this comment

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

Please add new line after the method.

* @param {Array} Array of nodes
*/
fromArray(arr = []) {
arr.map(node => this.append(node.value));
Copy link
Owner

Choose a reason for hiding this comment

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

Please use forEach instead of map since you're not using map function output.

@@ -190,10 +190,17 @@ export default class LinkedList {
return nodes;
}

/**
* @param {Array} Array of nodes
Copy link
Owner

Choose a reason for hiding this comment

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

Please provide correct type doc definition. It should look something like: @param {LinkedListNode[]} array - Array of nodes.

@trekhleb
Copy link
Owner

trekhleb commented Aug 6, 2018

I guess this is an outdated clone of your another PR #127 that has been already merged. So I think I'll just close this one.

@trekhleb trekhleb closed this Aug 6, 2018
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