Javascript__1725655981
Javascript__1725655981
Javascript Notes
Notes by:
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
00:59
02:12
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 1/58
04/09/2024, 10:36 Askify | View Notes
02:24
02:32
02:35
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 2/58
04/09/2024, 10:36 Askify | View Notes
this is called variable shadowing in ehich for that block where its
scope was limited temporairaly a changed tp "Hi"
03:28
Notes by:
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
03:21
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 3/58
04/09/2024, 10:36 Askify | View Notes
04:09
04:26
04:59
05:06
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 4/58
04/09/2024, 10:36 Askify | View Notes
05:27
Notes by:
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
06:27
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 5/58
04/09/2024, 10:36 Askify | View Notes
06:53
07:14
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 6/58
04/09/2024, 10:36 Askify | View Notes
07:20
07:12
the second step is it setups a memory heap for storing variables and
function references that means it takes all of the variables and
functions and stores it inside of this window object and the third step
is that it initializes those functions and variable declarations with
undefined
Notes by:
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
07:40
07:58
07:59
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 7/58
04/09/2024, 10:36 Askify | View Notes
during the execution phase the javascript engine executes the code
line by line assigning the values to variables and executes the
function calls also for every new function created javascript engine
creates a new execution context .
08:44
08:54
09:00
09:40
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 8/58
04/09/2024, 10:36 Askify | View Notes
09:52
10:32
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 9/58
04/09/2024, 10:36 Askify | View Notes
let helps to overcome the limitation of var which did not warned us
about the declaration earlier
Javascript Notes
Notes by:
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
11:12
13:25
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 10/58
04/09/2024, 10:36 Askify | View Notes
13:49
temporal dead zone is the term to describe the state where variables
are in the scope but they are not yet declared .
02:19
this will do is it's going to take each element of this array (nums) and
multiply by 3 and it's going to return a completely new array inside .
num,i,arr ki jagah kuch bhi p[ass kar do but ye dhayan rakho ki num
hai voh jo nums mai iterate karega
02:37
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 11/58
04/09/2024, 10:36 Askify | View Notes
03:21
in short filter returns only those elements from the array which
fulfills the provided criteria.
04:15
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 12/58
04/09/2024, 10:36 Askify | View Notes
basical
06:37
16:17
2)
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 13/58
04/09/2024, 10:36 Askify | View Notes
16:33
the second difference is that you can chain stuff on map so i can say
dot and something we can let's say if we want to do dot filter and do
some operation inside of this filter .
16:48
Approach 1)
18:01
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 14/58
04/09/2024, 10:36 Askify | View Notes
19:56
Notes by:
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 15/58
04/09/2024, 10:36 Askify | View Notes
21:34
22:35
these functions map ,filter and reduce allows chaining we can chain
other functions in front of these functions .
23:14
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 16/58
04/09/2024, 10:36 Askify | View Notes
24:42
25:46
01:03
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 17/58
04/09/2024, 10:36 Askify | View Notes
01:40
01:51
03:33
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 18/58
04/09/2024, 10:36 Askify | View Notes
03:45
04:56
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 19/58
04/09/2024, 10:36 Askify | View Notes
09:15
var use nahi karna bcoz uska block scope hota hai
11:27
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 20/58
04/09/2024, 10:36 Askify | View Notes
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
14:29
16:10
16:29
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 21/58
04/09/2024, 10:36 Askify | View Notes
16:14
here when we use this operator this is called rest operator ...nums
16:55
17:30
a=5
x=6
y=3
baki ...numbers mai hoga
18:37
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 22/58
04/09/2024, 10:36 Askify | View Notes
19:33
21:17
we cannot have the arguments key word inside the arrow function
23:10
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 23/58
04/09/2024, 10:36 Askify | View Notes
this inside the arrow function points to the global object where as
this inside normal function is pointing to the object use
08:43
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 24/58
04/09/2024, 10:36 Askify | View Notes
11:07
11:48
to convert back
14:52
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 25/58
04/09/2024, 10:36 Askify | View Notes
15:20
15:05
when we provide these two keys inside of this square bracket what
this will basically do is it's gonna only stringify level and health
18:54
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 26/58
04/09/2024, 10:36 Askify | View Notes
aise acess karna object mai sai usko kehte hai object destructuring
Notes by:
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
21:07
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 27/58
04/09/2024, 10:36 Askify | View Notes
11:31
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 28/58
04/09/2024, 10:36 Askify | View Notes
these are not part of javascript but they are ways we can use powers
of browser in js code
00:46
when the timer expiers it will go to the call stack by using the call
back queue bcoz it will not directly go to the call stack.
16:53
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 29/58
04/09/2024, 10:36 Askify | View Notes
17:23
the function of the event loop is to check the vallback queue and
whatever in it to the call stack and the call stack quickly executes
this call back function.
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 30/58
04/09/2024, 10:36 Askify | View Notes
when it sees the console.log() the it call the web api method console
so print "Start"
20:23
Notes by:
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 31/58
04/09/2024, 10:36 Askify | View Notes
22:07
In the web apis environment it registers the call back () mathod and
attach event click to it
22:43
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 32/58
04/09/2024, 10:36 Askify | View Notes
when any user click on the button the call back fuction is pushed
into the call back queue
and it waits over here for it turn to get executed .
The event loop has only one job to constantly moniter the call stack
and call back queue
34:20
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 33/58
04/09/2024, 10:36 Askify | View Notes
bcoz the microtask queue has the higher priority it gives chance to
the cbf fuction to get inside the call stack
35:08
36:03
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 34/58
04/09/2024, 10:36 Askify | View Notes
06:09
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 35/58
04/09/2024, 10:36 Askify | View Notes
08:40
07:14
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 36/58
04/09/2024, 10:36 Askify | View Notes
20:56
24:34
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 37/58
04/09/2024, 10:36 Askify | View Notes
Notes by:
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
29:55
31:18
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 38/58
04/09/2024, 10:36 Askify | View Notes
05:22
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 39/58
04/09/2024, 10:36 Askify | View Notes
promises.
10:17
18:06
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 40/58
04/09/2024, 10:36 Askify | View Notes
25:56
30:45
what ever errors are there before this catch will be handeled and
after the catch jo bhi then statemenet hai voh run ho jayngi
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 41/58
04/09/2024, 10:36 Askify | View Notes
02:12
02:59
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 42/58
04/09/2024, 10:36 Askify | View Notes
09:06
12:25
you will use the keyword await in front of a promise that has to be
resolved
12:42
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 43/58
04/09/2024, 10:36 Askify | View Notes
13:31
that await is a keyword that can only be used inside a async function
.
22:27
22:41
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 44/58
04/09/2024, 10:36 Askify | View Notes
22:26
26:38
32:25
44:28
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 45/58
04/09/2024, 10:36 Askify | View Notes
43:26
54:37
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 46/58
04/09/2024, 10:36 Askify | View Notes
54:23
this fetch returns a response so the response objects come over here
once this response object is here then once this response object is
here then we will do a DOT Json to convert that response body into
Json and instead of u can also convert it into string also convert it
into text also there are different type of values but I know that this
API will return me a Json right so to get that Json to read that Json .
01:00:59
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 47/58
04/09/2024, 10:36 Askify | View Notes
01:02:13
01:03:08
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 48/58
04/09/2024, 10:36 Askify | View Notes
there is a async function you can use await inside this async
function right to handle promises right and these promises are
asynchronous
01:06:25
so basically you don't have to do a promise fetch dot then dot then
but then it is helpful when you are doing promise chaining it makes
sense when you write code right so this line will only be executed
once
This Keyword
04:05
this keyword in global space will always have the value of global
object
05:29
a lot of students lot of developers don't understand this but let me tell
you in case of browsers this global object is window that is why you
see window written over here this window
05:45
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 49/58
04/09/2024, 10:36 Askify | View Notes
12:36
14:54
14:39
if you will call it like this window dox then it is the calling object
this window object it is the same window object hope you
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 50/58
04/09/2024, 10:36 Askify | View Notes
understood this
31:08
it will take the value of global object because this is now inside a
global space
Notes by:
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
31:23
32:28
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 51/58
04/09/2024, 10:36 Askify | View Notes
35:21
whenever you see an Arrow function the value of this this keyword
will be where this Arrow function is lexically enclosed
35:51
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 52/58
04/09/2024, 10:36 Askify | View Notes
36:29
this keyword will behave exactly like how it it would behave inside
the enclosing lexical context you know
36:44
09:55
10:41
fuction along with its lexical scope bundles to form a closure and
when a function is returned the whole closure is returned
05:35
3 seconds because promise.all will make all these three API calls in
parallel but it will wait for all of them to finish .
06:25
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 53/58
04/09/2024, 10:36 Askify | View Notes
08:56
09:39
. all will get rejected as soon as any any of these promises gets
rejected .
14:47
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 54/58
04/09/2024, 10:36 Askify | View Notes
the output will always be the output over here will always be an
array right of the same number of promises that you passed in right
so there there were three promises so this array will contain three
values.
15:16
18:28
20:28
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 55/58
04/09/2024, 10:36 Askify | View Notes
sabse teej wala agar fail ho jata hai then error will be thrown
24:11
Notes by:
https://www.linkedin.com/in/ramanjot-singh-5b574422b/
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 56/58
04/09/2024, 10:36 Askify | View Notes
24:23
27:12
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 57/58
04/09/2024, 10:36 Askify | View Notes
Pricing
See How
https://askify.video/view/youtube?_source=youtube_extension&_action=download_pdf&_id=5412b623-cf22-488f-a25f-f5b63785eac1 58/58