Funtion Syntax


#1

Can somebody help?

You can run this code by "calling" the function, like this:

sayHello("Emily");

Calling this function will print out Hello Emily.

Instructions
On line 11, call the greeting function and put in a name that you want the greeting function to include.
Press "Save & Submit Code" and see the function get into action! Saves you so much time.

var sayHello = function(Emily) {
    console.log('Hello' + Emily);
    };



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

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


#3

Could you post the link to the exercise? Looks like you want to reinvent the wheel when the exercise just asks to use it. Also do you know how this parameter works?

PS: @peterlearns_coding probably more like

greeting("your Name");

#4

You have to call your function. :slight_smile:

afte defining a function for example,

var my_function = function (param)  {    
console.log("My name is," + " " + param);
};
my_function("any string")

I called the function on the last line.


#5

On line 11, you need to call your function and put in a name that you want, for example "John".
Like this:

greeting("John");

And it will print Great to see you John


#6

thanks a lot guys, though im very new to coding, sometimes i get stuck in really simple problems! if u have any suggestions for beginners to progress fast in coding would make me so happy!

Thanks :smile:


#8

thank you very much! it really helps.

i would b also interested for books or tutorials that you know from experience that they really work :slight_smile:


#9

Sorry don't know any


#10

anyway was helpful! appreciate it


#11

Python for Beginners

Python for kids.

Dive into Python.

Learn Python

These are all really helpful books you can find online. :slight_smile:


#12

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