Java Sort Object Array Javascript Methods And Functions