Coding for fun. Coding for simple life.
[array].sort(function(a, b){ var nameA=a.name.toLowerCase(), nameB=b.name.toLowerCase() if (nameA < nameB) //sort string ascending return -1 if (nameA > nameB) return 1 return 0 //default return value (no sorting) });
Post a Comment
No comments:
Post a Comment