Intro to functions in JS HELP!


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;

// 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?


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


greeting is a function that take in one argument.

you can call it like this


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


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

what is it meaning by

Syntaxerror: Missing Before Statement