Problem with break

Hi everybody,
i need help i’m noob on imp and i want to break a function with if condition but when i put a break inside the if ide says that break has to be in loop block, i dont know why ,if some one could help me

Like the error says, “break” is used for prematurely terminating a loop. If your goal is to stop executing a function early, you probably want “return” instead.

For example:

function foo(bar) {
    if (bar == true) {

    server.log("if you can read this, bar is false!");

ok,thanks a lot gino