// This line of code should never execute!
// Analysis
return null;
}

This line of code is somewhat superflous. When a function returns a value, it must always return a value. If a return is made in a conditional, the function must return a value outside of the conditional as well.

Unless the browser knows something that I don't, the code inside the loop should always return a value. However, the browser will assume that I've overlooked a situation in which none of the return statements are called, but the loop exits. Without this line, the browser chokes and complains that a function must always return a value.

I tried to reason with the computer, but it didn't do any good, so I threw this line of code in to appease it.

Close Window