AmrendraKumar572683
8 views
12 slides
Oct 19, 2024
Slide 1 of 12
1
2
3
4
5
6
7
8
9
10
11
12
About This Presentation
asfdasdcdsaddsdfdfsdfsdsdaa;'sac
Size: 4.97 MB
Language: en
Added: Oct 19, 2024
Slides: 12 pages
Slide Content
JAVASCRIPT Date-02/02/2024
Functions , Synchronous and Asynchronous function
Overview Why Javascript Functions in Js single threaded nature of js Synchronous Function Asynchronous Function 01 02 03 04 06
since we all know our Browser understands only HTML, CSS and JS. Another reason is it can be used for the the client side development as well as server side development. Why Javascript
Functions in Js Function takes some input , do some logic and then returns a value/output. Functions let you- Abstract out logic in your program. Functions can take other function as an input(callback functions).
single threaded nature of Js It will use only one core of machine at a time. Due to this nature of js, it is considered a bad language for scalable system. Simply, Js runs line by line. http://latentflip.com/loupe/
Synchronous function One after one. Sequential . Only one thing happens at a time. http://latentflip.com/loupe/ As the name suggests synchronous means to be in a sequence, i.e. every statement of the code gets executed one by one. So, basically a statement has to wait for the earlier statement to get executed.
Asynchronous function Opposite of Synchronous. Executes in parts. Multiple things are parallelpiped (i.e. delegate or Context Switch); http://latentflip.com/loupe/ Async simply allows us to write promises-based code as if it was synchronous and it checks that we are not breaking the execution thread.