0% found this document useful (0 votes)
2 views

JavaScript Function Types 1738067666

The document provides an overview of various types of JavaScript functions, including Named Functions, Anonymous Functions, Arrow Functions, Immediately Invoked Function Expressions (IIFE), Callback Functions, and Recursive Functions. Each type is briefly explained with how it works and its use cases. The content is aimed at helping readers understand and utilize these function types effectively.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

JavaScript Function Types 1738067666

The document provides an overview of various types of JavaScript functions, including Named Functions, Anonymous Functions, Arrow Functions, Immediately Invoked Function Expressions (IIFE), Callback Functions, and Recursive Functions. Each type is briefly explained with how it works and its use cases. The content is aimed at helping readers understand and utilize these function types effectively.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

JavaScript tips

JavaScript
Function Types

Slim toumi
Slim toumi
JavaScript tips

Named Function
A function with a name. You can call it by using its name.

👉 How it works:
You create the function using function and a name.
To run it, type the name followed by ().

Slim toumi
Slim toumi
JavaScript tips

Anonymous Function
A function without a name, often used where a function is
needed temporarily.

👉 How it works:
This function is created on the spot and doesn’t need a name.
It’s used directly inside another function, like setTimeout.

Slim toumi
Slim toumi
JavaScript tips

Arrow Function
A shorter way to write functions, introduced in ES6.

👉 How it works:
Use => instead of function.
It’s great for writing short, clean code.

Slim toumi
Slim toumi
JavaScript tips

IIFE Immediately Invoked Function Expression

A function that runs as soon as it’s created.

👉 How it works:
Wrap the function in () and add () at the end to run it
immediately.

Slim toumi
Slim toumi
JavaScript tips

Callback Function
A function passed to another function to run later.

👉 How it works:
One function (like greet) takes another function as an input
and runs it.

Slim toumi
Slim toumi
JavaScript tips

Recursive Function
A function that calls itself until it finishes a task.

👉 How it works:
The function runs repeatedly, reducing the number each
time.
It stops when the number is 0 (a "base case").

Slim toumi
Slim toumi
JavaScript tips

Hopefully You Found It


Usefull!
Be sure to save this post so you
can come back to it later

like Comment Share

Slim toumi
Slim toumi

You might also like