I wanted to return the largest number at integer[0]
list1= [4,6,2,1,9,63,-134,566]
var max = function(list)
{
var bigToSmallList=[] //makin an empty list to return the biggest value at position 0
list.sort() // sorting it into numerical order small to big
for(i=list.length;i<list.length;i--) //want to iterate from the end to the start
{
bigToSmallList.push(list[i])//adding next largest to list
console.log(bigToSmallList) //just checking what's up
}
return bigToSmallList[0]; //should return the biggest value at position 0
}
max(list1)