sortascending() just sorts the array. It does not even return a sorted array. Something like:
PHP Code:
temp.lowest = temp.arr.sortascending()[0];
Would just set temp.lowest to null.
I guess you could make a sortascending2 and do:
PHP Code:
function sortascending2(arr) {
temp.result = temp.arr;
temp.result.sortascending();
return temp.result;
}
Then:
PHP Code:
temp.lowest = sortascending2(temp.arr)[0];
temp.indexOfLowest = temp.arr.index( temp.lowest );
Should work.