Python Array Get Function Javascript Code