DEV Community

Arul .A
Arul .A

Posted on

What is Function?

  • A function is a block of code designed to perform a specific task, and it runs only you call it, it uses to reduce the code repetition.

  • A function includes function keyword, function name, followed by parenthesis(), followed by curly brackets{}.

Syntax:

function name (){

}
Enter fullscreen mode Exit fullscreen mode
Example:
function dish(){

console.log(" ready")
}
dish()

Enter fullscreen mode Exit fullscreen mode

Top comments (0)