update javascript sort algorithms