Asynchronous in Javascript
Hello viewers, whats up!! Here i am back again with the new post of asynchronous in javascript. Javascript is a high level programming language used for known as web development. With this you can create dynamic and interactive content on websites.
Syntax is similar to that of other programming languages like java and C. It is client side scripting language and when we talk about its Data types , it is support various data types, including numbers, strings booleans objects, arrays and functions.
Here we have a problem about Asynchronous execution in
javascript. Question is suppose that we have 3 execution
in one program
# first one takes 2 seconds
# second
one takes 5 seconds and
# third one takes 1
seconds
but execution is coded in line by line first, second, third. So, in case of
Asynchronous and yeah javascript is an Asynchronous language but which one is
printed first. First we need to understand what is Asynchronous and how is it
works?
Asynchronous
In JavaScript, asynchronous programming is a way to handle operations that might take some time to complete, such as reading from a file, making a network request, or waiting for a user input. Asynchronous programming helps prevent blocking the execution of code, allowing other tasks to continue while the asynchronous operation is being performed.
How is it works?
The asynchronous working process in JavaScript involves handling tasks that
might take some time to complete without blocking the execution of the entire
program. This is crucial for web development, where operations like fetching
data from an API, reading files, or responding to user input may introduce
delays.
Let's code
setTimeout(() => { console.log("technically, I am the first person") }, 2000); // 2 seconds setTimeout(() => { console.log("technically, I am the second person") }, 5000); // 5 seconds setTimeout(() => { console.log("technically, I am the third person") }, 1000); // 1 second
# Install redux and saga packages - CLICK HERE
# Make reducer wrapper - CLICK HERE
# Action in reducer - CLICK HERE
# Reducer in redux -
CLICK HERE
# Switch Stmt in redux -
CLICK HERE
# Get data in component from redux - CLICK HERE
# Remove from cart - CLICK HERE
# Add Redux Toolkit in react redux saga - CLICK HERE
# Configure MiddleWare saga - CLICK HERE
# Call API with Saga and Set Result in react redux saga - CLICK HERE
# Product list ui with API data in react redux saga - CLICK HERE
# Remove to Cart with ID react redux saga - CLICK HERE
# Add Routing and Make Cart Page - CLICK HERE
# Show Added To Cart Product with Price Calculation -
CLICK HERE
Disclaimer
0 comments:
Post a Comment
For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.