```
let listeners = [
  function() {
    console.log(1)
    listeners.shift()
    listeners.push(function() {
      console.log(3)
    })
  },
  function() {
    console.log(2)
  }
]
listeners.forEach(function(f) f())
```

That should print just one instead it prints 1, 3