I have an array and I am sorting it but I need to sort everything except one element of my array.
My array is:
var Comparison = [
{key: \"None\", val
var Comparison_sort = this.Comparison.sort(function (a, b) {
if(a.key == b.key) return 0;
if (a.key == 'None') return -1;
if (b.key == 'None') return 1;
if (a.key < b.key)
return -1;
if (a.key > b.key)
return 1;
return 0;
});
tells "do a regular sort, except if the key is none which means it must go first."