Java Sort Object Array Javascript Mdn Settimeout