I was wondering how I can sort an array on a custom order, not alphabetical. Imagine you have this array/object:
var somethingToSort = [{ type: \"fruit\"
Array.sort accepts a sort function where you can apply custom sorting logic.