The loop condition is a function reference. Did you intend to call the function?
In the conditional expression part of a loop statement, a function name is not followed by a set of parentheses that enclose the function arguments. The function name by itself refers to the Function object for the function; it does not refer to value that the function returns.
Although using a Function object as the loop condition may be useful in certain circumstances, such as when the function itself is changing, this is most likely an error.
To correct this error
-
Use the function-calling syntax with parentheses enclosing the function arguments to evaluate the function value.