Just 2k after compression! Check it out on Github.
All joking aside, this whole thing can basically be accomplished by two built-in JS methods, ‘shift’ and ‘push’. It’d take a few more lines to apply a buffer size limit and type enforcement, so the whole excersize was one of expressed concept rather than utility. (I had to prove I understood the ‘head’ and ‘tail’ concepts.)
Anyway, I plan on going back to make use of the shift and push methods now that the assignment is complete.