Intro to functions in JS HELP!


#1

Here i don't know what I am doing wrong, can someone help me out here please :slight_smile:

// Nicely written function:

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

// Badly written function with syntax errors!

greeting var func{name}(console.log(name)))}

2. How to call the greeting function when the above is fixed?

ANSWER BELOW:

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


#2

greeting is a function that take in one argument.

you can call it like this

greeting(Your_argument_goes_here);

check your code here. you are printing a string "name" is that your intention?


#3

yes, and the "console.log" is the only line i have to fix?

what is it meaning by

Syntaxerror: Missing Before Statement