Skip to content

Commit

Permalink
Use of es6
Browse files Browse the repository at this point in the history
  • Loading branch information
impressi-web authored Jan 10, 2021
1 parent 6bca9dd commit 7074fc5
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions exercises/each/solution/solution.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
var http = require('http')
, async = require('async');
"use strict";
const { get } = require("http");
const async = require("async");

async.each(process.argv.slice(2), function(item, done){
http.get(item, function(res){
res.on('data', function(chunk){
});

res.on('end', function(){
done(null);
});
}).on('error', function(err){
done(err);
});
},
function(err){
if(err) console.error(err);
});
async.each(
process.argv.slice(2),
function (url, done) {
get(url, (res) => {
res
.on("data", (chunk) => {})
.on("end", () => done(null))
.on("error", done);
}).on("error", done);
},
function (err) {
if (err) console.error(err);
}
);

0 comments on commit 7074fc5

Please sign in to comment.