๐—๐—ฎ๐˜ƒ๐—ฎ๐—ฆ๐—ฐ๐—ฟ๐—ถ๐—ฝ๐˜ ๐—™๐˜‚๐—ป๐—ฐ๐˜๐—ถ๐—ผ๐—ป๐˜€

Functions are blocks of code for specific tasks. You run them when you call them.

Use functions to:

Create a function with the function keyword. Give it a name. Use parentheses. Put your code in curly brackets.

Variables inside a function stay local. Only the function sees them. This lets you use the same name in different functions.

Store function results in variables. Use functions in math or assignments.

How functions work:

Source: w3schools.com Optional learning community: https://dev.to/vidhya_murali_5aabe7784bd/functions-in-javascipt-19ei