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

Functions are blocks of code. You write them once and use them many times. They perform specific tasks.

Why you need them:

How they work: A function sits idle until you call it. To run a function, use its name followed by parentheses. The parentheses tell the computer to execute the code now.

Syntax rules:

Inputs and outputs: Functions work in a cycle.

You can store the result of a function in a variable.

Local variables: Variables created inside a function stay inside that function. This is called local scope.

Source: https://www.w3schools.com/js/js_function_intro.asp

Full post: https://dev.to/vidhya_murali_5aabe7784bd/functions-in-javascript-38h8

Optional learning community: https://t.me/GyaanSetuAi