Skip to main content

What is a function?

A function is a block of code that can be executed when it is called. Functions are used to perform specific tasks and can be reused throughout a program, making it more organized and efficient.

function hello() {
console.log("Hello World!");
}