const data = new Promise((resolve, reject) => { setTimeout(() => { const success = true; if (success) { resolve("Data fetched successfully!"); } else { reject("Error fetching data."); } }, 1000); }); try { const result = await data; console.log(result); } catch (error) { console.error(error); } How does await keyword work without async keyword, in the above code i have used await keyword before promise, for me i'm getting SyntaxError: await is only valid in async functions
Bro. Check this video description. There is a playlist. That playlist has lot of videos in order. You can start from the first video. If you complete all the previous videos, you will understand this easily.
Bro don't worry, in the beginning it's very defficult to understand these things please go and watch from first video not only one time please watch again and again, try to understand every single word
clear explanation with the example Anna. Thank you😍.
You are welcome 😊
very clear understanding about async and await ,even i dont know java script, nice work anna
Thank you 😊😊
Fantastic and crystal clear explanation bro..thanks for the Playlist
Thank you bro. 🥰🥰🥰
Best explanation 😮 understood the concept so well
Thank you ☺️☺️
Nice one brother Iam a fullstack developer thus the main reason because of this kind of channels keep rocking bro ❤️🔥😌
Thank you bro.
super bro vera level thanks bro
😊😊
thanks a lot my fav one ☺️
🥰🥰
❤
Thank you bro. Can you tell me any real case example?
Brilliant❤
Super
Thanks you 😊😊
const data = new Promise((resolve, reject) => {
setTimeout(() => {
const success = true;
if (success) {
resolve("Data fetched successfully!");
} else {
reject("Error fetching data.");
}
}, 1000);
});
try {
const result = await data;
console.log(result);
} catch (error) {
console.error(error);
}
How does await keyword work without async keyword, in the above code i have used await keyword before promise, for me i'm getting SyntaxError: await is only valid in async functions
anna need example asynchronous project ❤
Sure. Will do a video.
Bro, what theme are you using in this video in Visual Studio? Can you tell me its name?
Night Owl (No Italics)
can you share the complete code please for understanding, some are hidden
sir can you pls explain dataset in js
Sure will plan a video for that soon
Java script complete ayducha
No bro. Still there are topics.
I am a beginner sathiyama onnume puriyala
Bro. Check this video description. There is a playlist. That playlist has lot of videos in order. You can start from the first video. If you complete all the previous videos, you will understand this easily.
Bro don't worry, in the beginning it's very defficult to understand these things please go and watch from first video not only one time please watch again and again, try to understand every single word