1.

Write A Code Snippet To Sort String Array In Jquery?

Answer»

Below is the code SNIPPET which is used to sort the STRING array –

$(document).ready(function(){

var a4acarray = [ “Apple”,”ORANGE”,”BANANA”];

sortedarray = a4acarray.sort();

$(“#mycontrolID”).HTML(sortedarray.join(“”));

});

Below is the code snippet which is used to sort the string array –

$(document).ready(function(){

var a4acarray = [ “Apple”,”Orange”,”Banana”];

sortedarray = a4acarray.sort();

$(“#mycontrolID”).html(sortedarray.join(“”));

});



Discussion

No Comment Found