update stack.js

It's a better way to use `push/pop` instead of `add/delete`