Experimenting with queues in Python and JavaScript