5.Trying it all together


#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(Bob);
};

What is wrong with my code
it says "SyntaxError: Unexpected identifier"


#2

Looks like you forgot a curly bracket. ( { )


#3

missed curly bracket { after
var greeting = function (name)
and
console.log(Bob);
bob should be into ""
like-
console.log("Bob");


#4

I did what you said
// 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("Bob");
};
//But now it says
Oops, try again. You did not call the greeting function. Pass it a name!


#5

call the function after

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

like
greeting("bob")
but at first change the code
console.log(name) instead of console.log("Bob");
beacuse you are using function.Function can easy your work.

@nelsona0