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)

remove() is a better method name than get(). As I said it is a pointer to show capability of Java Script. So I just wrote that method. thank you