flâneur — a map of the web's best reading

Functions — reusable blocks of code - Learn web development | MDN

developer.mozilla.org · 3,299 words · saved by 1 readers

Another essential concept in coding is functions, which allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times. In this article we'll explore fundamental concepts behind functions such as basic syntax, how to invoke and define them, scope, and parameters. In JavaScript, you'll find functions everywhere. In fact, we've been using functions all the way through the course so far; we've just not been talking about them very much. Now is the time, however, for us to start talking about functions explicitly, and really exploring their syntax. Pretty much anytime you make use of a JavaScript structure that features a pair of parentheses — () — and you're not using a common built-in language structure like a for loop, while or do...while loop, or if...else statement, you are making use of a function. We've used functions built into

Functions — reusable blocks of code - Learn web development | MDN Skip to main content Skip to search Functions — reusable blocks of code Previous Overview: Dynamic scripting with JavaScript Next Another essential concept in coding is functions , which allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times. In this article, we'll explore fundamental function concepts like basic syntax, how to invoke and define them, scope, and param

Explore this link on the map →

related reading