Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9ca459f

Browse files
committed
Fix lint issue.
1 parent2a49b70 commit9ca459f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎src/data-structures/linked-list/LinkedList.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ export default class LinkedList {
5656

5757
/**
5858
*@param {*} value
59-
*@param {*} index
59+
*@param {number} index
6060
*@return {LinkedList}
6161
*/
62-
insert(value,index){
63-
index=index<0 ?0 :index;
62+
insert(value,rawIndex){
63+
constindex=rawIndex<0 ?0 :rawIndex;
6464
if(index===0){
6565
this.prepend(value);
6666
}else{
@@ -70,7 +70,7 @@ export default class LinkedList {
7070
while(currentNode){
7171
if(count===index)break;
7272
currentNode=currentNode.next;
73-
count++;
73+
count+=1;
7474
}
7575
if(currentNode){
7676
newNode.next=currentNode.next;

‎src/data-structures/linked-list/__test__/LinkedList.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('LinkedList', () => {
4545
linkedList.insert(10,9);
4646

4747
expect(linkedList.toString()).toBe('1,4,2,3,10');
48-
})
48+
});
4949

5050
it('should delete node by value from linked list',()=>{
5151
constlinkedList=newLinkedList();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp