Created
August 6, 2019 07:01
-
-
Save ANUPAMCHAUDHARY1117/e20fec0c4d923d87cd999f15d911871f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const request = require("request"); | |
| function getTheUrl(data) { | |
| var options = { | |
| url: "https://jsonplaceholder.typicode.com/posts/" + data | |
| } | |
| return options | |
| } | |
| function consoleTheResult(url) { | |
| request(url, function (err, res, body) { | |
| console.log(url); | |
| }); | |
| } | |
| for (var i = 0; i < 10; i++) { | |
| consoleTheResult(getTheUrl(i)) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment