In Javascript I need to order objects in an array according to type. Each type has a higher priority, so an object with the type "wipe" should have the highest priority therefore be at the front of the array(index=0).In Javascript I need to order objects in an arr