Javascript examples for JSon:JSon Object
Sort JSON data table alphabetical and case insensitive
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {// w ww .ja v a2s .com var names = [ {"FirstName":"A", "LastName":"Xb"}, {"FirstName":"B", "LastName":"xa"}, {"FirstName":"C", "LastName":"yc"} ]; names.sort(function(a, b) { return a.LastName.toLowerCase().localeCompare( b.LastName.toLowerCase() ); }); console.log(names); }); </script> </head> <body> </body> </html>