What does mean?


var calculate = function (number) {
var val = number * 10;

var greeting = function (name) {
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:


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.


this line in your greeting function:


it prints the function instead of the parameter (name)