how do I sort an array
var arr = new Array("word_12", "word_59", "word_17");
so that I get
["word_12", "word_17", "word_59"]
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you need to write a sort method (you can write any that you like) which splits the string on the _ and uses the second part as a numeric sort value.
Here’s a fiddle:
http://jsfiddle.net/eUvbx/1/