Im Trying to Build a table that allows me to rank Baseball Players by their numerical Atrributes (1 – 100)by traversing through an array and ranking all said arrays by the value of the number at a set index. For example, if an array is var arr = [John James, Starting Pitcher, 88] and 88 is a number from 1 – 100 representing speed, how could a loop be set up to where a column labeled speed, when pressed, would rank the arr[2] of say 50 different arrays that all have a speed rating at the [2] index. The Code Below is the closest I have. Would I have to nest an array inside of an array in order to be able to rank these attributes?
https://www.theshowratings.com/lists/bunting-bunt this link is to a website that loosely has the same feature of ranking players by a set attribute. any help appreciated
for (I = 0; I < arr.length; I++){
if (arr[2] == 99…..
user25122810 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1