
A function is a reusable block of code. Declare it with the function keyword, give it a name, and define its body in curly braces. Call it by writing its name followed by parentheses. Functions are the most important concept in JavaScript — they eliminate repetition and make code maintainable.
Reference:
TaskLoco™ — The Sticky Note GOAT