DEV Community

ViGnEsH
ViGnEsH

Posted on

Sample of function

2026 - April - 04

Function

In JavaScript, a function is a block of code designed to perform a specific task. funtion code one time write use it many times.

1. Function Declaration


2. Function Expression


3. Arrow Function


** More than one line code**


Types of function

  1. Function Declaration
  2. Function Expression
  3. Arrow Function
  4. Anonymous Function
  5. Named Function
  6. Callback Function
  7. IIFE (Immediately Invoked Function Expression)
  8. Recursive Function
  9. Higher-Order Function
  10. Constructor Function
  11. Generator Function
  12. Async Function
  13. Method (Function inside object)
  14. One-line Arrow Function

4 to 14 (to be discuss )


Top comments (0)