Javascript if else function issue


#1

cannot seem to get to work the following function .. can you please help ?


Replace this line with your code.


#2

Wrap the function body in curly braces.

var func = function (arg) {

};

#3

I still get the error ..


#4

Still showing some issues with missing curly braces.

var func (arg) {
    if () {

    }
    else {

    }
};

#5

With the changes I have made opening the second curly braces I now get a parse error ...


#6

There is no conditional expression in an else statement. It should only contain a block.

}
else {

}

#7

thank you ..


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.