Introduction

Functions are one of the most important concepts in JavaScript. They allow you to write reusable code, making your programs cleaner, shorter, and easier to maintain.

What is a Function?

A function is a block of code designed to perform a specific task. It executes only when it is called (invoked).

Syntax