Tying it all together (Please Help)

// 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)))}

1 Like

what is the problem?

1 Like

Let’s try to write some more lines in your code to call the function :smile:

im having a very difficult time with this as well, can someone help me out so i can quit pulling my hair out with this?

// 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=“Sam”

Oops, try again. You did not call the greeting function. Pass it a name!

I guess that I missed something…Can someone give me a hint?

Thanks

Got it! I was including the =

Yes this needs to be greeting(“Sam”) otherwise you overwrite your function.

// 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(‘peju’+ name);};
greeting (‘peju’);

need help pls

It works

var greeting = function (name) {
console.log(‘name’ + ‘=’+ name);
};
greeting (‘ramesh’);

1 Like

var greetings = function (name)
{
console.log(“Nice to meet you” + " " + name);
};
greetings(“Pruthav”);

this works, but there’s an error ‘Oops, try again. You did not call the greeting function. Pass it a name!’
How to fix this?

guess you need to use greeting without the s at the end.

you need a equal sign in the to Quatation mark next to the nice to meet you and the name