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

Commit8a9ea57

Browse files
fixed issue with delete operator on stacks (TheAlgorithms#218)
* fixed issue with delete operator using delete operator in arrays ,element remains undefined. so splice is the clean way to do that* Fixed the semicolon and let errors* Update Stack.js
1 parentedd5a69 commit8a9ea57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎Data-Structures/Stack/Stack.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var Stack = (function () {
3030

3131
this.top--
3232
varresult=this.stack[this.top]
33-
deletethis.stack[this.top]
33+
this.stack=this.stack.splice(0,this.top)
3434
returnresult
3535
}
3636

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp