My Blog

My WordPress Blog

My Blog

My WordPress Blog

4. JavaScript Functions

Function() Constructor

The Function() Constructor The JavaScript Function() constructor can dynamically create a function object at the run time. The functions created using Function() constructor have global scope only. The Function() constructor can be used to define the function at the run time, but you should use the Function() constructor with caution as it can lead to vulnerabilities in […]

Function Parameters

Function Parameters and Arguments The function parameters in JavaScript are variables listed inside the parentheses in the function definition. A function can have multiple parameters separated by commas. The function arguments are the values that are passed to function when it is called. We define function listing the parameters and call the function passing the arguments. The number of […]

Function Expressions

The function expression allows us to define a JavaScript function in an expression. JavaScript functions are defined using a function declaration or a function expression. The main difference between them is the function name. The function name can be omitted in function expressions. This helps to create anonymous functions in JavaScript. We can store the function expression in the […]

Functions

A function in JavaScript is a group of reusable code that can be called anywhere in your program. It eliminates the need of writing the same code again and again. It helps programmers in writing modular codes. Functions allow a programmer to divide a big program into a number of small and manageable functions. Like any other […]

Scroll to top