Promise in JavaScript Hindi | complete tutorial | promise all | chaining | race
HTML-код
- Опубликовано: 4 окт 2024
- in this javascript Hindi video tutorial, we learn how to use promise and how to done with promise and learn completely.
points of video
What is promise
Why we need it
Example of simple Promise
what is finally keyword
Exception handling with promise
Promise Channing
Error handling with promises
Promise.all
promise.allsettled
promise.race
• Promise in JavaScript ...
Checkout all course an playlist
/ phpstepbystep
Info tech video by bhasker verma
• Tech talks with Bhaske...
ECMAScript tutorial with interview Question playlist link
ruclips.net/p/PL8p2I9GklV46wKSUuvqBsBtU1gv9gSKKG
Promise.race(iterable)
Wait until any of the promises is fulfilled or rejected.
If the returned promise resolves, it is resolved with the value of the first promise in the iterable that resolved.
If it rejects, it is rejected with the reason from the first promise that was rejected.
in order to get the 1 st settled promise we need to apply " Promise.any(iterable)"
anyway great video.please keep it up.
sir ap bhagvan ho sir ap, etne time se Promise samajne ke liye time lag raha tha par, ess videos ko dekhne ke baad sab samaj aa gaya promise ke bare me, Thank you so much sir. This was asked me in some interviews i was unable to tell them, but now onwards i will give them the answer of Promise.
What a explanation.......... you cleared all my doubts about Promises ... Thank you.
Welcome bro
Thanks @Anil, I have watched several videos but this video has cleared all about Promise. You have nicely covered all topics about Promise.
❤❤
Don't know why such a well explain videos are not getting views and likes. Seriously bro. all my doubts are cleared. Thanks
welcome bro
seriously , I also think same.....I always like the way you explain sir great...keep it maintain always...lots of love from us
Thanks Anil ji, I always clarify my javascript doubt by going thru your videos. Your way of teaching in simplified manner is amazing.
Thanks sir today you clear my concept first time. i saw many videos but your simple method and informative video is best for me.
Thanks and welcome
very good explanation sir ab smjh aaya mujhe promise🙏🙏
Awesome video sir,
Keep it up, bahot hi achhe se samaj main aa raha he sir, superb 🙂😍
best way of teaching.
less time and more knowledge
Unbelieve able explanation sir ur great bhat asani se samjaya very nice .
I am following ur Videos motive as MEAN stack i know Angular still i will watch ur series at this time am on Express. I am 32 years old left IT now motivated.
God bless
I watched many videos of this topic but only this was very helpful for me. You cleared my all doubts.
Thank you Anil sir ,this video is very helpful for me
Thank you so much , best explanation , understood every concept about promise clearly🙏
Great sir bahut vdeo dekha ye vdeo clear kr diya doubt
Fantastic. I watched a lot of videos about Promise but was still confused till I found this video.
i have only watched only your one video but still i am liking your all videos ❤❤ thanks brother
nice explaining❤🎉🎉
love the way your teaching beacuse today i m crystal clear about promise and all method and this video is very helpful for me #thanks bhaiya
It's really helpful . I loved the way you present entire concept . Great job man
Wonderful I can't explain your understanding way I like it sir.thanx
best way of teaching
bhuot accha kaam krre ho bhai good luck
Thanks sir for explaining in such easy manner from scratch
Very nice and detailed video
Great video with very easy explaination. Keep making informative videos like this.👍
It would be great if you make video on async await.
Great tutorial......................Best Explaination 100/100
Nice Explanation..Thanks for the video
welcome
mujhe bada confusion tha isme.............. but thanks for solving all my doubts so easily
1 like from my side to make 1k like 😊
and this tutorial was very helpful to me
Gr8 vdo
Thnx a lot sir
A mistake is here, JavaScript code is not synchronous but it is Asynchronous.
2:10
Javascript is the synchronous single-threaded language but with the help of event-loop and promises, JavaScript is used to do asynchronous programming.
Promise.race(iterable)
Wait until any of the promises is fulfilled or rejected.
If the returned promise resolves, it is resolved with the value of the first promise in the iterable that resolved.
If it rejects, it is rejected with the reason from the first promise that was rejected.
in order to get the 1 st settled promise we need to apply " Promise.any(iterable)"
anyway great video.please keep it up.
amazing explanation
thank you so much sir
Lovely explanation bro, you killed it. I have seen many videos on promise but no one has explained it step by step like you. Would you mind having a quick person chat?
Such a great explanation 👏
Thanks brother for the great explanation!
superb sir
Bhaiya pata kaise chalega ki function me resolve call karna h ya reject
thank you so much bhaiya
but bhaiya aap jab code likhte ho tab zoom kr liya kro code chota dikhta he , or mobile me dekhne me dikkat aati he .
Nice explanation, thanks.
Great
Very well explained!! taken simple examples and modified the differences between them, its ok for the beginners, what if we use in advanced versions?
could be better if you go more deep into it!! Anyways thankyou Soooo Muchh!!!!!!!!!!!!!!
very nice
Superb explanation Anil....
Good explanation.
Thanks buddy for this
Recursion mai promise object return ho sakta hai ?
Api chaining sirf fetch() me hoti ya other libraries too ex- axios
Hello @Code Step By Step Sir
What will be the soln of example which you took in starting before explaining promises
Eg let data = 2
Console.log (data)
data =2
Settimeout(() => console.log(data),2000)
data =3
console.log('Timer':data);
Output Came as 1,timer:3,3
How can we get as 1,timer:3,2
Nice tutorial 🔥
sir event loop par video banea na plz, bahut baar pucha jata hein interview mein.
Hello Sir
What will be the solution of example which you teach in starting before explaining promises
Eg let data = 2
Console.log (data)
data =2
Settimeout(() => console.log(data),2000)
data =3
console.log(`out put is ${data}`);
they give this
timer:3,3
but i want this out put
timer:3,2
please explain this
cant we mention resolve and reject both together, code run hone ke baad pata chalega na ki error hai ki ni code me? then agar dono use kare and if anyofthem is true then execute that
Thankyou sir ji
No Words: 😍❤❤
Nice one
Thanks 🔥
quite amazing
nice explanation
u r amazing Anil sir:)
sir Axios pr ek video bna do full api k sath React me
Wonderful
Thank you
Sir to ham kah sakte he promise process ko asychnous bnata he right?
I am fetching the same url but its getting an error of cors policy: Response to preflight request doesn't pass access control check: Redirect not allowed for a preflight request.
Thanks for this !! You made it look so easy! At 23:28 console doesn't print error from catch block instead it is just throwing the error, so it really didn't enter catch block i guess?
yes, I was also thinking that
Warn me krrhe hai that's why 😀
do you have any beginner
to advance java script course here on youtube or udemy
mujhy async aur await bhi use krna hey promise ke saath me
I will make video on it
Anil sir
why we always written setTimeout in side promise ? what is actual need? please clear
to add some time gap in code execution
sir,
Javascript is syn or Asyn language ??
I am comfused , since somewhere it showing syn and some where its howing asyn , please help
its synchronus beacuse it have prototypal behaviour
@@JaiminkumarSonawane Thank You
Asyn await ka video bnao
const p1 = () => {
return new Promise((resolve, reject) => {
resolve('first')
})
}
const p2 = () => {
return new Promise((resolve, reject) => {
resolve('second')
})
}
Promise.all([p1, p2]).then((result) => {
return result.map((item) => item)
}).then((result) => {
return result.map((item) => item)
}).then((l) => {
console.log(l)
})
it is not resolving but every time it return array of promise
i can solve this by const p = new Promise((resolve, reject)=>{resolve('second')}) but i apply my approach its not working
help me on this sir
firstly you explained what problem we face when some line in our code take time, then you told promise solve this problem, but you didn't tell how it is solving, because still javascript doesn't wait and it executes the next lines.
so confusing
var a = 1;
console.log(a);
a = 2;
var data= new Promise((resolve,reject)=>{
setTimeout(()=>{
resolve(a);
},2000);
}).then(r => {
console.log(r);
});
a = 3;
console.log('last',a);
THIS CODE STILL GIVES THE SAME WRONG OUTPUT AS :
1
LAST 3
3
NOW WHATS THE POINT OF USING PROMISE?
sir volume to check krte aawaj hi bhut kam aa rhi h
sir start NodeJs project
sir... why you are using console.worn🙄
You can use console.log. no issue
Java Script execute ascync manner.
U mean asynchronous not synchronous
javascript is asynchronous not synchronous sir please correct this i video
you are wrong bro javascript always synchronous if you dont believe search on google
Dummy API nahi ..
thank you so much sir