[Solved] how to sorting array in javascript [closed]
[ad_1] Try this: var arr = [‘a_1’, ‘a_5’, ‘a_0’, ‘a_4’, ‘a_2’, ‘a_4’]; arr.sort(function(x, y){ return x.split(‘_’)[1] > y.split(‘_’)[1]}); alert(arr); Check this fiddle [ad_2] solved how to sorting array in javascript [closed]