fixed issue with delete operator on stacks (#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
This commit is contained in:
Harish sambasivam
2020-07-24 09:38:56 +05:30
committed by GitHub
parent edd5a69c4c
commit 8a9ea57f01

View File

@ -30,7 +30,7 @@ var Stack = (function () {
this.top--
var result = this.stack[this.top]
delete this.stack[this.top]
this.stack = this.stack.splice(0, this.top)
return result
}