Function Syntax Name Input


#1


I Cant understand when im coding in the tutorial of the function syntax. I wonder how do you put the name into the function cuz I didnt see the precise procedure for putting the name in. Any help will be really appreciated!!!


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

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


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

// On line 11, call the greeting function!
var sayHello = function (name) {
    name(Harry);
};


#2

To call a function, write the name of the function followed by an input inside of parentheses.

Example function call

function(input);

Remember the instructions are asking you to call the greeting function and give it a name. Name is your parameter/what you are putting into the parentheses.


#4

This is what I came up with and it works for me

// Below is the greeting function!
// See line 7
// We can join strings together using the plus sign (+)
// See the hint for more details about how this works.

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

// On line 11, call the greeting function!
greeting("jack");


#5

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