I have an array and I want to sort by the number field not the name.
var showIt = [
["nuCycleDate",19561100],
["ndCycleDate",19460700],
["neCycleDate",0],
["nlCycleDate",0]
];
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 can provide
sortwith a comparison function.aandbare items from your array.sortexpects a return value that is greater than zero, equal to zero, or less than zero. The first indicatesacomes beforeb, zero means they are equal, and the last option meansbfirst.