[JS,PY] How do I turn this into Javascript?
I'm trying to make this code in javascript. What it does is take two lists and sort them. The index of users is the same to the index of scores and I want it to stay like that. This code sorts Users based on how Scores would sort from. It then sorts the scores.
users = ['bob','bill','joe'] scores = [325,15,6784] sorted(users, reverse=True, key=lambda x: scores[users.index(x)]) sorted(scores, reverse=True)
Voters
use the sort method
@Coder100 I tried it and it didn't sort the string properly.
what went wrong @MisledWater79
oh it was backwards i see
https://replit.com/@Coder100/LumberingOrchidStructs-aeouae#index.js @MisledWater79
@Coder100 It still seems the javascript strings isn't right
oops i made a mistake there you go @MisledWater79
@Coder100 It works now thanks! I do have 1 more question how do I turn a list of strings into ints? I didn't realize my list was strings not ints.
@MisledWater79 well you can't convert
bob
to a number silly@Coder100 No I have strings like
"515632"
in a list and I want to convert those to ints