Bhai, I was trying to learn this from different sites bit was not able to understand. But aapne kya samjhaaya hai🔥. Love you bhai, aapka data science ka bhi playlist mast hai. All the best bhai ❤️.
@vishwasagrawal47004 жыл бұрын
Promise.then(console.log('harry bhai explained and fulfiled the promise').catch(console.log('ye kabhi print hi nhi hoga')
@preetiharjani16544 жыл бұрын
i tried oddEven exercise with promise: console.log('tut38(quiz)'); function oddEven() { return new Promise(function (resolve, reject) { setTimeout(function () { let n = 45; if (n % 2 == 0) { console.log('number is even'); resolve(); } else { console.log('number is odd'); reject(); } }, 5000); }) } oddEven().then(function () { console.log("Task resolved"); }).catch(function () { console.log("Oops!!Task rejected"); })
@oook34072 жыл бұрын
jan aap nay bht piyara function banaya ha
@avipraidey5767 Жыл бұрын
Very good 😊🙌
@hamidsahi4357 Жыл бұрын
but we can do same thing by using simple function so whats the difference question
@madhavjaveri14784 жыл бұрын
var marks=prompt("enter marks"); function papaPromise(){ return new Promise(function(resolve,reject){ score = parseInt(marks); if (score
@prajwalzingare73322 жыл бұрын
function number(n1, n2) { return new Promise((resolve, reject) => { if (n1 >= 0 || n2 >= 0) { console.log("Function: your promise has been resolved"); resolve(n1 + n2); } else { console.log("Function:your promise has not been resolved"); reject("sorry not fullfilled "); } }); } number(10, -20) .then((result) => { console.log("prajwal:Thanks for resolving " + result); }) .catch((error) => { console.log("prajwal:very bad" + error); }); great explanation thanks harry bhaii❤❤
@muhdani9874 жыл бұрын
Behtareen hogaya bhai... harry Bhai aap se Dil lagi hogai he yaar....💞💕❣️💌❤️💝💟💓💗💖 Ab aapke saaray coarses bhi dekhne ka iraada ban Gaya he... Love you 😘😘😘 From Pakistan ❣️
@akankshapatel95082 жыл бұрын
Very useful to understand this during my internship phase thank you!!!!!!
@Blackfeather77772 жыл бұрын
Hi can you help me with what questions you faced during your js interview ?
@the_xibalba4 жыл бұрын
I stumbled upon this video while searching for tutorials on promises, I had been so confused all this time. This worked for me! Thank you Bhai!
@harshchopra15883 жыл бұрын
Thanks Harry bhai! Your Quiz solution is here: function dish(){ return new Promise(function(resolve, reject){ setTimeout(() => { const error = false; if(!error) { console.log("Yes!promise is resolved"); resolve(); } else { console.log("No!promise is not resolved"); } }, 4000); }) } dish().then(function(){ console.log("Dish was tasty"); }).catch(function(){ console.log("Dish was insipid"); });
@karanveersingh55353 жыл бұрын
U haven't put reject() then what's the point of putting .catch() function .It won't be called .
@rajputayush60663 жыл бұрын
function myFun(num1,num2){ return new Promise(function(resolve,reject){ if((num1+num2) >50){ resolve(); }else{ reject(); } }); } myFun(70,30).then(function(){console.log("Number Is Greater then 50 ")}).catch(function(err){console.log("Number is less then 50")});
@andressergio15323 жыл бұрын
sorry to be so offtopic but does anyone know of a method to log back into an Instagram account..? I somehow lost my password. I would love any help you can give me
@ikeroliver71863 жыл бұрын
@Andres Sergio instablaster ;)
@andressergio15323 жыл бұрын
@Iker Oliver I really appreciate your reply. I found the site thru google and im waiting for the hacking stuff atm. Looks like it's gonna take a while so I will reply here later with my results.
@andressergio15323 жыл бұрын
@Iker Oliver It did the trick and I actually got access to my account again. Im so happy! Thanks so much you saved my ass!
@ikeroliver71863 жыл бұрын
@Andres Sergio you are welcome xD
@bisworajsaheb41714 жыл бұрын
Watching right after a year. Wish I had found it before. Thanks Harry bhai.
@karanludhani60725 жыл бұрын
Harry bhai dsa k lectures b jaldi upload kijiye... Hm logo k interviews ka time aa gya hai. Or apke lectures se bahot help milti hai.. thank you so much for giving all these contents
@nielltalwar15742 жыл бұрын
thanks harry for such a brilliant and simple explaination. here is my practise let p1=new Promise((resolve,reject)=>{ let input=prompt("enter a number"); if(input%2==0){ console.log("even number"); resolve("Hurray"); } else{ console.log("odd number"); reject("oh no!"); } }); p1.then((msg)=>{console.log(msg); return new Promise((resolve,reject)=>{ let name=prompt("enter your name"); if(name=="nitin"){ resolve(); } else{ reject(); } }) }).then(console.log("Nitin found. balle balle!")).catch((err)=>console.log("Promise rejected!",err));
@codewsohan3 жыл бұрын
You resolved your promise. Great explanation ! Loved it ♥️
@amiteshsinghpatel67052 жыл бұрын
D:sg
@amiteshsinghpatel67052 жыл бұрын
Pppppp
@gauravsingh49822 жыл бұрын
true
@abhisekupadhaya5 жыл бұрын
Sir, You are best KZbin programmer. Please, Make tutorial on OpenCV for python. I want to apply OpenCV in Machine Learning.
@Satish_Kumar_Gupta4 жыл бұрын
harry bhai aapne apna best promise video ko successfully resolve kar liya. Thank you so much...:)
@AkshitSangwan-v8l Жыл бұрын
Best Expalanation ever in the most layman language.
@maaz11504 жыл бұрын
Learning my entire engineering from here. Thank you.
@Shillu19885 жыл бұрын
Finally Today I have understand Promises, Thanks Bro
@av1shek_ps5 жыл бұрын
Can any one explain me or give me code how to use setTimeout in promise? Is it necessary to define function in promise only can we not give only name of function there and define it at any other place.
@av1shek_ps5 жыл бұрын
Bro if you know can you explain me
@av1shek_ps5 жыл бұрын
//Can anyone tell me how to wrap it with setTimeout function console.log('Now you are online.'); function callingfun() { return new Promise(function (resolve, reject) { let xhr = new XMLHttpRequest(); xhr.open('GET', 'kk1.txt', true); xhr.onload = function () { if (this.status === 200) { console.log(this.responseText); resolve(); } else { console.log('some error occured'); reject(); } } xhr.send(); }) } callingfun().then(function () { console.log('promise resolved'); }).catch(function () { console.log('promise rejected') });
@Virus-ke8xj4 жыл бұрын
@@av1shek_ps I think there's no point in using setTimeout function over here, I mean, what you are doing is sending a get request and checking the status of the response, there's not time involved right? If u want you can add it, but here it seems to be illogical
@Virus-ke8xj4 жыл бұрын
Just wrap everything starting from initialisation of XML object to the end inside the setTimeout function
@sohamnesarikar55164 жыл бұрын
Harry bhai...apne promise pura kiya...samaj aa gaya promise😄❤️
@anantraj10714 жыл бұрын
harry bhai ...bht jagh se try kra kia but atlast yha jake samjh aaya thnxxx bhaii!!!!!
@sourabhsivare18762 жыл бұрын
Bro great explaining, hats off to your efforts
@muneebzubair50694 жыл бұрын
promise resolved() with Love from Pakistan Lahore Punjab ❤️
@dr.ramkishorsah4954 жыл бұрын
waah kya explanation so easy to understand to learn a complex thing. Salute🤘🙏🙏🙏
@abhimalvekr1274 жыл бұрын
Good one bro. Bohot ache se samjhaya bhai ne! Keep up the good work
@kartikeykakaria8a1683 жыл бұрын
Sir maine kahi jyada jagahon se promises sikhne ki koshish ki par samajh nahi aaya par aapki video dekhke pehli bar mein hi samajh aa gya. You the best programmer on youtube! One request : pls make a tutorial on sql also please :)
I think I searched all sites, books but not got the concepts this much clear . Thank you very much Bhai. please make a series on react and node too
@paramsaini69322 жыл бұрын
Best In The World (ABOVE ALL) THANKS bro
@rpnrko36122 жыл бұрын
Understood in one go. Patte se headshot Harry bhai!!!
@travelnlearn2 жыл бұрын
mast hai bhai maja aa gaya
@savanpatel96414 жыл бұрын
thank you bhai ...........u r d best youtube programmer ever................
@parmarmayank70874 жыл бұрын
You are amazing brother. God bless you
@hassanahmed82162 жыл бұрын
Amazing explanation!!!❤️❤️❤️
@utkarshsingh29122 жыл бұрын
console.log('Promise Quiz') function promise(){ return new Promise(function(resolve, reject){ let understood = true; if(understood){ resolve(); } else{ reject(); } }); } promise().then(()=>{ console.log('Thankyou harry bhai sab samjh me aagya'); }).catch(()=>{ console.log('Samjh ni aya') })
@pratikpawar3763 жыл бұрын
//Harry bhi ka promise function pratikpromise(){ return new Promise(function(resolve, reject){ setTimeout(()=>{ let error = false; if(!error){ console.log("Harry bhai ka video dekha samaj me aa chuka hai as per the promise of harry bhai"); resolve(); } else{ console.log("Harry bhai ka video phir se dekh le samaj aa jayega"); reject(); } }, 1000) }); } pratikpromise().then( function() { console.log("Thank you So much Harry Bhai"); }).catch(function() { console.log("Sorry Harry bhai, lekin koshis karuga samaj ne ki") });
@javeriyakhan17732 жыл бұрын
promise resolved!! well explained!!👍
@TechnicalAnkesh3 жыл бұрын
Harry bro as always you resolved your promise LOVED YOUR EXPLANATION🤩🥰
@vieharchives82082 жыл бұрын
// If you know Python, this concept is similar to Try and Except. // Here is simple example of Promises function oddEven(number) { return new Promise(function (resolve, reject) { if (number%2==0) { resolve(); } else { reject(); } }) } oddEven(16).then(function () { console.log("Your number is Even") }).catch(function () { console.log("Your Number is Odd"); })
@anubhavverma15912 жыл бұрын
Promise Resolved Thanks Harry ❤
@sports4yoo2 жыл бұрын
3M Soon Harry Bhai big congratulations in advance 🎉❤
@vikaschauhan-rv6fi3 жыл бұрын
starting mai laga tha ki nahi aayega samajh mai, par 1 dum badiya se samajh aagaya
@karthikjoshi63864 жыл бұрын
Famous club concept if (age
@afsanatasnim35422 жыл бұрын
ur comment helped me to know the difference
@afsanatasnim35422 жыл бұрын
thnks
@ibtehaj952 жыл бұрын
Thanks a lot bro. You explained it very well.
@harshpreetsingh69712 жыл бұрын
Thanks for resolving your promise ♥️🙏💯
@Saifolic5 жыл бұрын
it's really very useful thanks a lot
@ajinkyajadhav80493 жыл бұрын
function sum(a,b){ return new Promise (function(resolve, reject){ let c = a+b; if (c >100){ console.log("Sum of A and B is : ",c) resolve("sum is greater than 100") } else{ console.log("Sum of A and B is : ",c) reject("sum is less than 100") } }) } sum(10,23).then(function(a){ console.log(a); }).catch(function(b){ console.log(b) })
@bantisharma81194 жыл бұрын
Best Video for learning Javascript. Thank you harry bhai
@vivekkumar-pc1xy2 жыл бұрын
mein just abhi brad traversy ka lecture attend kiya tha udemy se, Promises ka. Difference itna hai apne us lecture ko hindi mein explain kr diya. But mughe ab smgh agya
@osamakhan25523 жыл бұрын
I have watch this video 4 time now finally i'm understand 😍
@Unrealinsaan724 жыл бұрын
The way you are explaining is really good.
@khelanmehta15543 жыл бұрын
Awesomeeeee bro dhang se samhjha diya tune
@mrinalraj71662 жыл бұрын
Thank you harry bhai. You are god.
@webprogramminghindiurdu32794 жыл бұрын
Bohut acha explain kiya bhai ap ney
@Travelmoments4 жыл бұрын
Sabashhhh!!!!! bhahut badiya samjaya apne..
@shrutigoyal34944 жыл бұрын
you nailed it. and yes it is a resolve.
@TheCuratedUX2 жыл бұрын
great content
@thevarunparashar4 жыл бұрын
You are an amazing guy... keep it up
@Rahulyadav-ry1lk5 жыл бұрын
Sir ke fan like thoko👈👌🤙
@Rahulyadav-ry1lk5 жыл бұрын
Big fan
@vipinsaini34974 жыл бұрын
Hi. Your tutorial is informative. I loved it. Thanks for sharing and keep the good work going
@javascriptwar95254 жыл бұрын
you save my life brother..🙌awesome
@ayushajayuzfmvwfenu77203 жыл бұрын
after buying the Coding ninja web dev course, come here to catch on, easy to understand video loved it ❤️
@webcreationstudio70883 жыл бұрын
apne course liya tha kiya?
@ayushajayuzfmvwfenu77203 жыл бұрын
@@webcreationstudio7088 yes
@VedPrakash-kf6kv3 жыл бұрын
congratulation for 2million hary bhai
@insaanonline3 жыл бұрын
thanks
@yashwantsahu17524 жыл бұрын
promise done perfect harry bhai ...
@anaskhan48413 жыл бұрын
Much Much Appreciated Harry Bhai...
@sugandhaparasher88613 жыл бұрын
Super Dost... very well explained
@vaibhavkulkarni56014 жыл бұрын
Very nicely explained Harry bhai !!
@parshantmadaan4709 Жыл бұрын
Your promise resolved Thanks
@deepakguled809 Жыл бұрын
I initially watches your promises on ultimate javascript course very confusing there here clearring explained my suggestion kindly upload this in that playlist
@pushkarkumar55784 жыл бұрын
bhai gajab padhate hoo app maja agaya :*
@MuhammadBilal-fw7gh3 жыл бұрын
Harry bhai you really resolved your promise❤😉
@shivamnayak29982 жыл бұрын
function compare(a,b){ return new Promise(function(resolve,reject){ if(a===b) resolve("Equal"); else reject("Not equal"); }) }; const genericFn = (str) => console.log(str); compare(3,4).then(genericFn).catch(genericFn);
@hmmmza2 жыл бұрын
function isDay(hours){ return new Promise(yes, no){ if(hours>5 && hours
@hitenarya49875 жыл бұрын
Harrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrry bhai awesome video :D
@Hassanali-tj1kq2 жыл бұрын
bhi muzy tu maza a agya phr na ma mara pura samj ma a gaya thank you bhi
@moderngypsy59802 жыл бұрын
How should I thank you Harry bhai, you are the best..
@nayankumarshit75225 жыл бұрын
Harry bhai i like your django tutorials.. love you vai
@iamSadabAlvi5 жыл бұрын
I am always ready for your video Like too banta hai
@akashsolanki55703 жыл бұрын
@codewithharry please explain the Promise constructor. Isn't it supposed to make a object, which should look like this {...} when we do console.log(func1())
@ibtehaj952 жыл бұрын
Yes, Promise will create a new object. Harry just chained more stuff to it and probably displayed it (I don't remember the timestamp). I wrote very simple code to make myself understand, it might help. ///////My Code//////////// let oath_keeper = 0; const promiss = new Promise(function(accept, excuse){ if(oath_keeper === 1){ accept("Oath Kept"); } else{ excuse("Oath Broken"); } }); promiss.then(function(message){ console.log(`Message from Promiser: ${message}`); }).catch(function(message){ console.log(`Message from Promiser: ${message}`);; });
@lopamudrasahu22022 жыл бұрын
superb brother
@ashpreetsinghanand72602 жыл бұрын
function f2(){ return new Promise((resolve,reject)=> { setTimeout(() =>{ let flag=true; if(flag==true){resolve();} else{reject();} }, 2000}; }); } f2.then(()=>{console.log("no error from API");}).catch(()=>{console.log("error");})
@msbasera2 жыл бұрын
Thank you bhai ❤️
@pranaykosulkar6414 жыл бұрын
Harry Bhai you resolved your promise 🙏 ❤️👍
@subhasishsahu97493 жыл бұрын
thanks bro i was so confused about this and you helped me a lot .
@khatariinsaan52842 жыл бұрын
Mai aap logo se promise karta hu ke mai aap logo to *promise* acche tarike se batunga What a way to teach 😂😍
@sushmapatil44782 жыл бұрын
Wow very nice
@shaheensiddiqui19523 жыл бұрын
sir we are always see you full vidio
@aasrivastava58515 жыл бұрын
Your videos are very good sir.Appreciate your youtube work. Please make a video on AJAX
@CodeWithHarry5 жыл бұрын
I have already uploaded a video no Ajax with title "Ajax tutorial in hindi" Kindly access the playlist!
@AbhaySingh-dd9xc4 жыл бұрын
@@CodeWithHarry harry bahii bilkul right
@abhijitbarman44014 жыл бұрын
Harry bhai apne promise pura kardia!
@Ertyuiigff-sq5fi3 жыл бұрын
superb video
@divyanshuverma32052 жыл бұрын
Hillarious sometimes - " mai aapse promise krta hu ki aapko ...Promise() ... achhe se btaunga yahi hota hai promise" 😂🤣😂🤣😂
@tanmoyhaldar45143 жыл бұрын
I think my iitkkgp profs will also not teach me like this. Loved the way you used examples.
@prit77873 жыл бұрын
THANKS HARRY!!
@muhammadjunaid23293 жыл бұрын
Love from Pakistan Bhakkar🧡
@fattehalisunasarasunasara41115 жыл бұрын
Sir materialize css ki series banavo please
@networkguy66504 жыл бұрын
Thanks buddy..... btw liked+subscribed
@biswamohandwari64604 жыл бұрын
Tussi great ho
@laxmipriyapradhan17042 жыл бұрын
Please harry kya ap ye 4 concept ko milake ek website banana sikha sakte ho please please please🙏 - Generator - Promises - AJAX Request - - Callback Function