Function

Functions in JavaScript

Functions in JavaScript bring out the real flexibility of the language. Functions can be stored in variables, defined at runtime. Even inbuilt functions can be redefined. Declaring functions function add(a,b) { return a+b; } a and b are the 2 parameters. I can call this function in the following way add(3,4).…