Syntax of function


#1

I can't win this exercise , my cod is correct , no ?

var saluer = function (nom) {
    console.log("Content de vous voir," + " " + nom);
};


var saluer = function (les ordinateurs) {
    console.log('saluer'+''+ nom);
};

I'm French

Link of this exercise :

https://www.codecademy.com/fr/courses/javascript-beginner-fr-FR-rpcse/0/3?curriculum_id=5355c2b7516bcbd912000008#

Thank you !:innocent:


#2

var saluer = function (nom) { // nom is function parameter
    console.log("Content de vous voir," + " " + nom); // here you used parameter nom
}; // it's correct code

#3

I don't think you need to functions for this exercise so just this one will do,

you may remove this one,

What you need to do is call your function with any name as a pararmeter,

saluer("n'importe quel nom");


#4

What you need to do is call your function with any name as a pararmeter,

... as an argument


#5

The term actual parameter and argument are the exact same thing. So calling it an argument or parameter will and can still suffice. :slight_smile:


#6

Thanks for your help !


#7

I know that function parameters are the names listed in the function definition and function arguments are the real values passed to (and received by) the function (from w3school.com). I'm confused.

From MDN (Descripyion section):

The parameters of a function call are the function's arguments. Arguments are passed to functions by value.

As for me it's not same :slight_smile:


#8

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