const calculateArea=function(widht,height){const area= width*height
return area;};
calculateArea(5,6)
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));
You misspelled width
the first time.