Syntax error


#1



Some error in the syntax?


var perimeterBox = function(length, width); {
    return length + length + width + width;   
}

console.log(perimeterBox(5,5));


#2

You can find the syntax for a function expression here:


#3

this line:
`
var perimeterBox = function(length, width); {

the semi-colon in this line prevents the function from executing properly, remove the semi-colon


#4

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