I am trying to create a while loop in Javascript. I have a an array called numbers that contains 5 numbers. I also have a variable called bigone that is set to 0. I am trying to write a while loop that has an if statement that compares each value in the array to bigone. When the number in the array slot is greater then bigone, I want to assign that number to bigone. I cant figure it out. Here is what I have so far but it wont work. Yes this is homework and NO I am not asking for the answer, just for some guidance in the right direction. Here is as far as I have gotten :
while ( numbers.length < 5 ) {
if ( numbers > bigone ) {
bigone = numbers
}
}
Any ideas?