Région de recherche :

Date :

https://developer.mozilla.org › fr › docs › Web › JavaScript › Reference › Statements › return

return - JavaScript | MDN - MDN Web Docs

L'instruction return met fin à l'exécution d'une fonction et définit une valeur à renvoyer à la fonction appelante.

https://www.w3schools.com › jsref › jsref_return.asp

JavaScript return Statement - W3Schools

The return statement stops the execution of a function and returns a value. Read our JavaScript Tutorial to learn all you need to know about functions. Start with the introduction chapter about JavaScript Functions and JavaScript Scope.

https://stackoverflow.com › questions › 7629891

javascript - Functions that return a function - Stack Overflow

Calling the function with in a return statement executes the function, and returns whatever value was returned by the function. It is similar to calling var x = b(); , but instead of assigning the return value of b() you are returning it from the calling function a() .

https://developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Statements › return

return - JavaScript | MDN - MDN Web Docs

Learn how to use the return statement to end function execution and return a value to the caller. See syntax, description, examples, and browser compatibility for plain, async, generator, and async generator functions.

https://mindsers.blog › fr › post › fonction-instruction-return-javascript

[JS] Comprendre l'instruction de retour des fonctions - Mindsers Blog

L'instruction de retour nous permet de retourner le résultat de l'addition de cette façon : return result. En d'autres termes, l'instruction return nous laisse indiquer clairement à l'interpréteur JavaScript ce que la fonction va retourner comme valeur. Dans notre exemple, il y a deux variables utilisées.

[JS] Comprendre l'instruction de retour des fonctions - Mindsers Blog

https://developer.mozilla.org › fr › docs › Learn › JavaScript › Building_blocks › Return_values

Valeurs de retour des fonctions - Apprendre le développement web - MDN

Pour retourner une valeur d'une fonction que vous avez créée, vous devez utiliser le mot-clef return. Nous avons vu son utilisation dans l'exemple random-canvas-circles.html. La fonction draw() dessine 100 cercles aléatoires dans un élément HTML <canvas> : js. function draw() { .

https://www.w3schools.com › js › js_functions.asp

JavaScript Functions - W3Schools

Function Return. When JavaScript reaches a return statement, the function will stop executing. If the function was invoked from a statement, JavaScript will "return" to execute the code after the invoking statement. Functions often compute a return value. The return value is "returned" back to the "caller":

https://web.dev › learn › javascript › functions › return

The return keyword - web.dev

Use return to specify the value that the function should produce as a final result. When the interpreter reaches a return statement, the function that contains that statement immediately ends, and the specified value is returned to the context where the function was called: const myFunction = function() { return 2 + 2; } myFunction(); . > 4.

https://runebook.dev › fr › docs › javascript › statements › return

JavaScript - return [fr] - Runebook.dev

Description. L'instruction return ne peut être utilisée qu'au sein des corps de fonction. Lorsqu'une instruction return est utilisée dans le corps d'une fonction, l'exécution de la fonction est arrêtée. L'instruction return a des effets différents lorsqu'elle est placée dans différentes fonctions :

https://www.freecodecamp.org › news › javascript-return-statements

JavaScript Return Statements - freeCodeCamp.org

JavaScript Return Statements. Introduction. When a return statement is called in a function, the execution of this function is stopped. If specified, a given value is returned to the function caller. If the expression is omitted, undefined is returned instead. return expression; Functions can return:

JavaScript Return Statements - freeCodeCamp.org