DEV Community

ViGnEsH
ViGnEsH

Posted on

Call back function_Single Threaded_forEach

April/14/2026

Call back function

A callback function is a function pass is go another function in agrument is excuted leter.

  1. A function can accept another functiona as a pass.
  2. Callback allow one function to call another at later time.
  3. A callback can excuted afer another function has finished.

Here, name()is passed a callback to name1(),which excutes after the name.


Single Threaded

JavaScript run in single thread.

It can only exceute one task event task.
Multi task in one program there are one by one run speed.
A issues sometime support have a task is a time consuming.
One block run start next one.


forEach

This is a array method only used array.
A javaScript array forEach is built in method used excuted of provided funcion one for a element in a array

normal function:

Arrow Function:

Here, automatically create value, index, array in forEach method.
What are we want used there value any one or three so.


Top comments (0)