Order maintenance data structure for Javascript