Below you will find pages that utilize the taxonomy term “Javascript”
May 29, 2023
JavaScript: functions
As any programming language, JavaScript allows to pack useful things into functions, and it is the key to good JavaScript knowledge, to use them efficiently. In this post, I describe three ways that the functions can be declared in JavaScript, talk about visibility of variables inside the functions, how to have optional function arguments with default values, how to create closures (functions, bound to outer variables), and how to use recursion.