Sort Array Based On Property Javascript Interview Coding