5 Tying 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 (hello) {
};
console.log(gre);


#2

and the question is?


#4

i got thru no worries


#5

Did you get it correct?

Tip, check:
- Introduction to Functions in JS
-- Meet the Functions
-- 3. Function syntax

There you will find your solution. :slight_smile:

Cheat sheet (just an example):

// Badly written function with syntax errors!
var greeting = function (name) {
console.log("This is" + " " + name);
};
greeting("TheName");


#6

I submitted the following:

var greetings = function (name) {
console.log("Hello" + " " + name);
};

greetings("Ramon");

Everything seems to work. The console logs "Hello Ramon". but I get a message that says, "Oops, try again. You did not call the greeting function. Pass it a name!"


#7

Turns out the problem is that I was supposed to name the function "greeting", not "greetings".


#8