Tying it all together (Please Help)


#1

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

what is the problem?


#3

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


#4

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?


#5

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


#6

Got it! I was including the =


#7

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


#8

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


#9

It works

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


#10

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?


#11

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


#12

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