Article From:

What is the reason for this?

var http = require('http');
var urls = ['', '', '']
function fetchPage(url) {
    http.get(url, function(res) {
        console.log("You have successfully requested "URL".})}For (VaR I = 0; I < urls.length; i++) {FetchPage (I)}

Answer 0:

You are hereiIt’s index. To loop, it should be passed in the function.urls[i]That’s all right.

Answer 1:
for(var i = 0;i < urls.length;i++) {
//I is the number here! It should be introduced to URL.FetchPage (I)}

Link of this Article: Http.get () reported wrong in node

Leave a Reply

Your email address will not be published. Required fields are marked *