Functions in Javascript | Javascript Tutorial




Explore Functions in JavaScript — declaration, expressions, invocation, and more.
A function is a subprogram designed to perform a particular task.Functions are executed when they are called. This is known as invoking a function.A Function Declaration defines a named function. To create a function declaration you use the function keyword followed by the name of the function. When using function declarations, the function definition is hoisted, thus allowing the function to be used before it is defined.
A Function Expressions defines a named or anonymous function. An anonymous function is a function that has no name. Function Expressions are not hoisted, and therefore cannot be used before they are defined. In the example below, we are setting the anonymous function object equal to a variable.

Link to my Websites :-
Suraj Bahadur github : https://surajbahadur.me/
Suraj Bahadur Website : https://surajbahadur.tech
Suraj Bahadur Facebook – https://www.facebook.com/surajbahadur591
Suraj Bahadur Instagram – https://www.instagram.com/surajbahadur58/

– suraj bahadur

Original source