My code:
var company=new Array("Kestrel Moon:","BB:");
var basicPri=new Array(1165,1231);
for(var i=0;i<15;i++){
var companyTotal=company[i].concat(basicPri[…
document.write(""+companyTotal+"")
It shows on the screen:
Kestrel Moon: 1165
BB: 1231
I want to sort the array so that it goes ascending order of highest value of price so it should display it as:
BB: 1231
Kestrel Moon: 1165
A normal sort would not do it as it would sort the prices but the company names stay where they are, how do I sort both arrays so it would display what I want to display?
Thank You