-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Conversation
Function gor through array and add all nodes to linked list.
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@seIncorp looks like test checks are failing. Could you please cover your function with tests? |
/** | ||
* @param {function} [callback] | ||
* @return {string} | ||
*/ | ||
|
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.
Why do we need empty line here?
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.
It was miss type
*/ | ||
fromArray(arr = []) { | ||
arr.map(node => this.append(node.value)); | ||
} |
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.
Please add new line after the method.
* @param {Array} Array of nodes | ||
*/ | ||
fromArray(arr = []) { | ||
arr.map(node => this.append(node.value)); |
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.
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 |
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.
Please provide correct type doc definition. It should look something like: @param {LinkedListNode[]} array - Array of nodes
.
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. |
Function gor through array and add all nodes to linked list.