filmov
tv
Callbacks Asynchronous And Synchronous in Node and JavaScript

Показать описание
In this tutorial, you will learn how to create callbacks for asynchronous and synchronous methods in javascript or node.
Node is single threaded. Unlike in other languages writing code in synchronous style for io, is not acceptable. This is because of it bocks event loop.
Callbacks are used in the node to carry out this IO. So learning about callbacks is important.
Learning callbacks in the node is a bit tricky. In this tutorial first, we will creat e synchronous function without callback. Then we will convert this synchronous function into the synchronous callback. Once we understand how to create callbacks we switch to create asynchronous callback.
Node is single threaded. Unlike in other languages writing code in synchronous style for io, is not acceptable. This is because of it bocks event loop.
Callbacks are used in the node to carry out this IO. So learning about callbacks is important.
Learning callbacks in the node is a bit tricky. In this tutorial first, we will creat e synchronous function without callback. Then we will convert this synchronous function into the synchronous callback. Once we understand how to create callbacks we switch to create asynchronous callback.