Functions in JavaScript | JavaScript Functions

Publié le: 04 août 2019
sur la chaîne: Rai Gurukul
333
82

What is a Function?
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.
Values can be passed into functions and used within the function.
Functions always return a value. In JavaScript, if no return value is specified, the function will return undefined.
Functions are objects.

Define a Function.
There are a few different ways to define a function in JavaScript:
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.

Syntax:
function name(parameters){
statements
}

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.

In this tutorial by using an example explained all the aspects of function.

#javascript #learnjavascript #javascripttutorial
******
Did you enjoy the video? If so, give it a like above!

Subscribe to our channel for more techie video
👉 https://www.youtube.com/c/DeepakRai?s...

Keep Learning!! Keep Growing!!

P.S. Make sure to keep up with us by clicking the bell!


Sur cette page du site, vous pouvez voir la vidéo en ligne Functions in JavaScript | JavaScript Functions durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Rai Gurukul 04 août 2019, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 333 fois et il a aimé 82 téléspectateurs. Bon visionnage!