Skip to content

Instantly share code, notes, and snippets.

@dacur
Created March 18, 2015 16:36
Show Gist options
  • Select an option

  • Save dacur/531bf62be5e0ad35cbce to your computer and use it in GitHub Desktop.

Select an option

Save dacur/531bf62be5e0ad35cbce to your computer and use it in GitHub Desktop.
_solutionsContainer is an array of objects. This code sorts the objects in the array by their 'Order'. Order is an integer that was assigned to the objects when they were created (based on how many 'pros' the user selected; i.e., 7 pros checked meant the Order was 7). Note: listing 'b' first in the return statement means that they are listed hig…
_solutionsContainer = _solutionsContainer.sort(function(a,b) { return (b.Order) - (a.Order) });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment