Closed rustycell closed 6 years ago
One handy technique when debugging these problems is to use run
instead of verify
so that you can see only your program output and any errors it produces. Here's some example output I got from learnyounode run prog.js
with your code:
Lets throw a brizzie to stands out like a mate. As cross as a vee dub my shazza got us some rip snorter. As stands out like rego where he's got a massive mokkies. He hasn't got a boil-over when trent from punchy divvy van. We're going uluru bloody as busy as a rego.
So, your code actually is outputting something, and in fact if we look more closely to the output you provided, we can see that 3. ACTUAL:
has some content. Your program is providing output, but only in 1 out of 3 cases. Reading your code again, can you spot the reason why?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Notes
i am getting no output for chapter "Juggling Async" in C9. i cannot visualize what is going wrong here, your help is highly appreciated..
below is the problem statement. "This problem is the same as the previous problem (HTTP COLLECT) in that
you need to use http.get(). However, this time you will be provided with
three URLs as the first three command-line arguments.
You must collect the complete content provided to you by each of the URLs
and print it to the console (stdout). You don't need to print out the
length, just the data as a String; one line per URL. The catch is that you
must print them out in the same order as the URLs are provided to you as
command-line arguments.
"
If you have a problem with an error message:
Error output
My Code
// var http = require('http'); var bl = require('bl');
http.get(process.argv[2], function (response){ http.get(process.argv[3], function (response1){ http.get(process.argv[4], function(response2){ response.pipe(bl(function(err, data2) { response.pipe(bl(function(err, data1){ response.pipe(bl(function(err, data){ console.log(data.toString()) console.log(data1.toString()) console.log(data2.toString()) }))
}).on('error', function(e){ console.log(e.message);
});