𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻𝘀, 𝗧𝗵𝗿𝗲𝗮𝗱𝘀, 𝗮𝗻𝗱 𝗘𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻

Understanding JavaScript fundamentals helps you write better code. Here is a breakdown of functions, processes, threads, and execution styles.

𝟱 𝗧𝘆𝗽𝗲𝘀 𝗼𝗳 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻𝘀

𝗣𝗿𝗼𝗰𝗲𝘀𝘀 𝘃𝘀. 𝗧𝗵𝗿𝗲𝗮𝗱

A Process is a program running on your computer.

A Thread is a small unit inside a process.

𝗦𝘆𝗻𝗰𝗵𝗿𝗼𝗻𝗼𝘂𝘀 𝘃𝘀. 𝗔𝘀𝘆𝗻𝗰𝗵𝗿𝗼𝗻𝗼𝘂𝘀

JavaScript is single-threaded. This means it handles one task at a time.

Synchronous Execution:

Asynchronous Execution:

Source: https://dev.to/kamalesh_ar_6252544786997/types-of-function-and-threads-process-and-synchronous-vs-asynchronous-in-javascript-1hhd