In addition to what is said, I would suggest that you consider if you want only one “highestNum”. I’m not saying that you need more than one variable, just that you may not want to use that one state for all the numbers. Is that what you are supposed to be checking? You might also want to think about where you are doing your push.
You insert log statements wherever you want to know what is going on.
A big part of being a good developer is being a good debugger. And a lot of being a debugger is being a detective. You have to investigate. Just start logging out information and seeing if it matches what you expect it to be. If you log it out and it matches your expectation, move forward and find where it stops. If it doesn’t match your expectations, more backwards and find where it stopped. Try it with different data to see how it handles different conditions.