Report Error in introduction to functions


#1


// Nicely written function:
var calculate = function (number) {
    var val = number * 10;
    console.log(val);
};

// Badly written function with syntax errors!

var greeting = function(name){
    console.log(name);} 
greeting();

I wrote the call to the function with no arguments and submit the result and I passed the exercise. I would like to suggest one test to be sure that the param is not undefined. Thanks

#2

you have to pass the function an argument, because you gave it the parameter, 'name', that means that you need to call it and it would look like

greeting("Kylea");

#3

It is like @kyleaw said. You typing in your parameter that you want the computer to show on the screen. You have programmed your code to show a greeting on the screen you have typed out when ran. If you leave that greeting blank the computer will still run the correct code and show nothing on the screen thus passing it :smiley:


#4

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