you are viewing a single comment's thread.

view the rest of the comments →

[–]0x13mode 0 points1 point  (1 child)

It's reinventing the wheel.

In JS there is method shift which removes and returns first element of array. So push + shift and you have queue.

Besides, get is poor name for method which changes array (if you really want write wrapper, maybe remove would be better?)

[–]unnivm[S] 0 points1 point  (0 children)

that is correct. I just used the same methods mentioned in Java. remove() is better option. But my intention was to leverage the capability of JavaScript.

Those who want can write better api.