Img Credit : @hiteshchoudhary
Now we have a function which will take a variable as argument & that will modify the value. In this case we can sum 10 and return it.
Now if you want to do some other things like subtraction, multiplication & division. Then you have to write three separate function.
what if we can tell the function to modify the value according to our needs. Like we will pass the logic what we need instead of write same code multiple times.
wow ! Now we can add our different Login in different function. So now the function is pass with argument thats call Callback function.
If there has any issues or wrong instruction, please feel free to contact with me by comments or mail: hello@rathik.dev
← Previous postWhat is Javascript Hoisting ?
Next post →Understand Javascript Closure with Example