can u make a program that will ask for 12 numbers and display an option.It will display the entered number from high to low or low to high based on option.
1
Expert's answer
2012-11-08T09:06:52-0500
Click the button to sort the array. 1-9 sort9-1 sortfunctionmyFunction() { var points= [40,100,1,5,25,10]; points.sort(function(a,b){returna-b}); varx=document.getElementById("Sorts"); x.innerHTML=points; } functionmyFunction2() { var points= [40,100,1,5,25,10]; points.sort(function(a,b){returnb-a}); var x=document.getElementById("Sorts"); x.innerHTML=points; }
Comments