Not able to call function expression can any one help me with this

const calculateArea=function(widht,height){const area= width*height

return area;};

calculateArea(5,6)

It is because you are creating the function wrong. In order to use the function keyword to create a function you have to name it like this:

function calculateArea (width, height){
// Your code here
};

And in order to print this wherever you want; Let’s say you want the console for now, you have to log the function call on the console.

console.log(calculateArea(x,y));
2 Likes

You misspelled width the first time.

const calculateArea=function(width,height){const area= width*height return area;}; const result = calculateArea(5,6) console.log(result);
3 Likes