I referenced so many videos to find the exact difference between asyn await and promises but you explained the practical approach in a much simpler way to understand. Thank you.
setTimeout function gets called and queued for every iteration of the for loop. But it doesn't execute the callback function written inside. It gets executed only after 1000 milliseconds as specified as an argument. By that time, the for loop has been executed for 10 number of iterations and the value of var i is now 11. It's evident that for loop has executed that quick, the reason why we see "Ended" printed in the console.
I did same with foreach loop in different case, it was not working, so i came to this video and checked here you have used forloop and tried same then it's working... What's the problem with forEach?
Can you please make a video on complete MERN stack developer (full stack developer) interview rounds and questions....I'm fresher and on you tube thr are only frontend or backend..but no one is guiding for full stack
Somebody help me in this problem Please write solution in javascript Write a function called do_allocation(number_of_people, number_of_buses) The function should return a list of number of people who can get into the next bus that comes in based on the following logic: Each bus’s capacity is the sum of the capacities of the previous two buses. Once all the people get in, then the buses can continue, but will have 0 people inside it. This is the case when the number of people are less and there are more buses. So after all the people are already boarded, then the remaining buses will have 0 people boarding. The output of the function is an array/list with the same length as number_of_buses. The total of this output array/list should be less than or equal to the number_of_people. The first bus’ capacity can be set to 1 by default. E.g. Def do_allocation(number_of_people, number_of_buses): …. Your code…. Return array[number of people got into first bus, number of people got into second bus, …. , number of people who got into last bus]
You must have millions subscribers. One of the best channel I found on youtube where you have lots of examples with correct definition
I referenced so many videos to find the exact difference between asyn await and promises but you explained the practical approach in a much simpler way to understand. Thank you.
Glad to know it helped 😀😀
Most underrated channel Ma'am .Thank you
Thanks Nisha Singla, same method using ES6 arrow functions
const delayOne =(x) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(x);
}, 2000)
})
}
const test =async() => {
console.log("started")
for(i=0;i
Simple and Great explanation
Amazing explaination
Loved this video
Thank you 😊
All videos are really informative and helpful 👍👌
This video cleared my all confusion related to promises. Great 👍 Thanks Mam
Beautiful explanation. Very easy to understand with your examples.
Glad it was helpful!
Thanks for the video 😊
Thank you 😊
Best video ever 👍
Very simple explanation Nisha...
Nicely explained 👍
Thank you 😊
Thanks for the video.., superrr helpful👍👍👍
Really helpful 👍
Liked the way of explanation
Thanku very much
super explanation.
Thank you mam!
heya nisha i just finished ur angular playlist and it helped me understand some concepts, will you ever do a NGRX playlist thanks!
Very simplified explanation loved it 👍, please do make this interview questions type of video more 😅
Thank you 😊
Hi Nisha, content is good and way of explanation is very nice.
just loved your explanation can you share all code so we can use it as note before intrerview
4:11 why its displaying 11 still I am not able to get . anyone ?
setTimeout function gets called and queued for every iteration of the for loop. But it doesn't execute the callback function written inside. It gets executed only after 1000 milliseconds as specified as an argument. By that time, the for loop has been executed for 10 number of iterations and the value of var i is now 11. It's evident that for loop has executed that quick, the reason why we see "Ended" printed in the console.
There is no Closure at the time 5:23
I did same with foreach loop in different case, it was not working, so i came to this video and checked here you have used forloop and tried same then it's working... What's the problem with forEach?
Can you please make a video on complete MERN stack developer (full stack developer) interview rounds and questions....I'm fresher and on you tube thr are only frontend or backend..but no one is guiding for full stack
p͎r͎o͎m͎o͎s͎m͎ 😓
Somebody help me in this problem
Please write solution in javascript
Write a function called do_allocation(number_of_people, number_of_buses)
The function should return a list of number of people who can get into the next bus that comes in based on the following logic:
Each bus’s capacity is the sum of the capacities of the previous two buses.
Once all the people get in, then the buses can continue, but will have 0 people inside it.
This is the case when the number of people are less and there are more buses. So after all the people are already boarded, then the remaining buses will have 0 people boarding.
The output of the function is an array/list with the same length as number_of_buses.
The total of this output array/list should be less than or equal to the number_of_people.
The first bus’ capacity can be set to 1 by default.
E.g.
Def do_allocation(number_of_people, number_of_buses):
…. Your code….
Return array[number of people got into first bus, number of people got into second bus, …. , number of people who got into last bus]