5. Lesson 5 error


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/0/5?curriculum_id=506324b3a7dffd00020bf661


greeting var func{name}(console.log(name)))}

my code:

var greeting = function(name){
function= (console.log("Greetings" " + " " + name);};
greeting("Sarah");


It's coming up with an error: SyntaxError: Unexpected token =

Replace this line with your code.


#2

HI a function should have that structure

var functionName = function(parameter) {
   #do something with the parameter
}
#Here call the function
functionName("here put some argument");

#3

is there anything you can identify about MY code that would be incorrect?

var greeting = function(name){
function= (console.log("Greetings" " + " " + name);}
greeting("Sarah");


#4

Yes here. .

function= (console.log("Greetings" " + " " + name);}

You should remove The

function=

Then remove the () around

(console.log("Greetings" " + " " + name);

#5

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