This file contains 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 axios = require('axios'); | |
async function follow(url) { | |
const { data } = await axios(url); | |
// display the route | |
console.log('data: ', data); | |
// the end: nothing to follow | |
if (!data || !data.follow) return; |
This file contains 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
/* | |
* A simple function that returns the objects between a range of given values, and grouped by a given key | |
*/ | |
Array.prototype.customFilter = function(group, range, low, high) { | |
if (!(array instanceof Array)) { | |
throw new Error("Invalid array"); | |
} | |
var result = {}; |