simple queue in JS using shift/unshift
queue in ruby