learnyounode icon indicating copy to clipboard operation
learnyounode copied to clipboard

fix(exercise 12): test GET request for fail #446

Open hoijui opened this issue 7 years ago • 3 comments

This is still missing most of the translations for the doc change. This implements a TODO comment.

Note that I am totally new to Node.js and JavaScript, so i might be doing many things wrong here. Please give feedback so i can fix it. have a good day! :-)

hoijui avatar Feb 18 '18 23:02 hoijui

do you have any hints maybe? as said, i am totally new to this.

hoijui avatar Feb 25 '18 08:02 hoijui

Yeah, we can think of this as if we are using setInterval just to call the function one more time with another parameter(incrementing count).

One way is we can use recursion, after finishing the first call, it'll go call the same function with next parameter.

Other is to use a for loop, this approach will be async which means all the requests will be sent in parallel.

You can try and experiment with these

AnshulMalik avatar Feb 25 '18 08:02 AnshulMalik

hmmm.. i am sorry to respond this late. i remember i first tried simpler solutions liek the ones you sugguested, but the tests would fail, because there were things we had to wait for, so in some way, waiting will be necessary. should i use some wait(<milliseconds>) or sleep(<milliseconds>) kind of call?

hoijui avatar Jun 27 '18 06:06 hoijui