संदेश

ASCENDING DESCENDING

< p > ASCENDING  ORDER </ p > < p id = "demo" ></ p > < script > const points = [ 40 , 100 , 1 , 5 , 25 , 10 ]; points . sort ( function ( a , b ){ return a - b }); document . getElementById ( "demo" ). innerHTML = points ; </ script > < h > DESCENDING ORDER </ h > < p id = "demo1" > descending order : </ p > const points1 = [ 40 , 50 , 60 , 45 , 99 , 78 , 86 , 42 ]; points1 . sort ( function ( a , b ){ return b - a }); document . getElementById ( "demo1" ). innerHTML = points1 </ script >
हाल की पोस्ट