Syntax error


#1

var greeting = function (name); {
console.log("Great to see you" + " " + name)
}

Greeting("Anjali");

what is the wrong in above code?


#2

You shouldn't have a semi colon ;


#3

Hi and you call your function

Greeting()

Instead of

greeting()

#4

var Greeting = function (name)
console.log("Great to see you," + " " + name);

Greeting("Anjali");

my code is shown above, where is error? it says syntax error


#5

Like @zainabrawat said just remove the ;

var greeting = function (name);  <== this one

Dont remove the { }


#6

someone says remove this :{ , someone says don't remove , what i do actually.
I am stuck with this section for a long time . Can anyone do clear my problem

I done the same what you @wizmarco say but it still says syntax problem


#7

Like that

var greeting = function (name)  {
console.log("Great to see you," + " " + name);
}
Greeting("Anjali");

And since you declare a function greeting() so when you call it

greeting("Anjali");

You should use greeting() instead of Greting()


#8

Thank you so much
finally, i crossed this


#9

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.