How to sort an array of objects based on object priority value

join shbcf.ru