What does mean?


#1

var calculate = function (number) {
var val = number * 10;
console.log(val);
};

var greeting = function (name) {
console.log(greeting);
};
greeting("king ram");
I wrote this code and it ran successfully and it result [Function]
Why [function]?????
there are not Function string in my code:sweat:


#2

JavaScript doesn't understand what you mean so does what it can to honor the command by printing the object class.

greeting() {}

is an object of the Function class.

What we need to do is work with the formal parameter, name, known as the argument. One suspects you are asked to display a greeting message of some sort.

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

Now when we call the function with,

greeting("King Ram");

the output to the display will be,

Nice to meet you, King Ram

Be sure you are reading the lesson text thoroughly, and re-read until the ideas are clear in your mind. Don't push forward until you are completely comfortable at each step. There is no hurry. Slow and steady wins this race.


#3

this line in your greeting function:

console.log(greeting);

it prints the function instead of the parameter (name)