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

A function is a block of code. It performs a specific task.

Stop repeating your code. Put it in a function. Call it when you need it.

Learn these two terms:

Example: Parameters: rice, masala, chicken. Arguments: Basmati Rice, Spicy Masala, Chicken.

Use return to send a value back from a function.

JavaScript uses hoisting. It moves declarations to the top before the code runs.

Source: https://dev.to/raja_b_0c9d242e2c26cf063b/function-3bjd