it was complaining that the FunctionDeclaration was inside a block (IfStatement) so it asks to change it to a FunctionExpression instead. - FunctionDeclaration is hoisted, FunctionExpression isn't.