Function Data Flow

How function work in JavaScript

 

Here is Default syntax of function:



Steps:

1st: When we call the function with arguments(10,20), both arguments stored in 
parameter (parameter1, parameter2
                                                                ๐Ÿ‘‡

2nd: then it stored in function body where it called like we called both parameter with 
return statement
                                                                ๐Ÿ‘‡

3rd: when we use return  statement then the operation of parameter (here we sum both parameter)
stored in function name(function_name)
                                                                ๐Ÿ‘‡

 Final step: when we call or invoke the function name with arguments it shows the function body operation with arguments finally in console
 
                                                         1st Step ๐Ÿ”Final step


Now you can store the return operation in a variable and then print it in Console

 ๐Ÿ‘‰Now call this above function with arguments(10,20)
 then- store sum operation of function body that 
 we pass with return statement --finally stored in 
 in function name and now we can call it when we need


                                                     or


๐Ÿ‘‰Store function body operation(here sum operation) in a variable then return it with return 
statement in function_name





 

Comments

Popular posts from this blog

How function return an Array in JavaScript