Python Array Sort Function In Javascript W3