Better initialize the var before the if, and use it in the if condition