[js] when listeners are removed, we currently have a dangling key left, so re-create an array on event re-assignment