Could you please write a jsdoc to comment how exactly are the tabs reordered. It's not obvious from the code.

Also, how can newIndex be greater than tabs_.length? I'd just print an error if this happens. We do not want undefined's in tabs_.