Skip to main content

Posts

Showing posts from July, 2020

DAY 9 - JULY 30

FUNCTION BASIC FUNCTION SYNTAX function  f.name(parameter) { } EVERY TIME WE NEED TO CALL/INVOKE THE FUNCTION function   add ( a ,  b ) {       console . log ( a  +  b ) }   var   a  =  add ;  // function add(a, b)   var   b  =  add ( 3 , 5 )  //8 console.log / return inside function function   add ( a ,  b ) {       console . log ( a  +  b ) a - b } Console.log(a+b) will display the output directly If u want to use the output of this function as data for other line u need to use return . If we use both it will print console and log immediately and store the return value in the variable return RELATED PROBLEMS PROBLEM 1 function   myfun ( a ,  b ) {      console . log ( "hi" );      if  ( a  ==  10 ) {      ...