Javascript Select Last Element In Array Python