Node Ecosystem, TDD, CI/CD
Review, Research, and Discussion
Describe (in plain English) what Array.map() does
The array.map() function iterates over an array and runs a call back for each element. it will always return you a new array of the same length as the original array comprised of your return values .
Describe (in plain English) what Array.reduce() does
The reduce() method executes a reducer function (that you provide) on each element of the array, resulting in a single output value .
Provide code snippets showing how to use superagent() to fetch data from a URL and log the result
-
With normal Promise .then() syntax :
####
superagent.get(‘/someOtherUrl’).then(data=>{console.log(data.body)}).catch(err=>{console.error(err)})
-
Again with async / await syntax
####
let getUrlData=async()=>{
let data=await superagent.get(url);
console.log(data.body);
}
getUrlData();
—————————————-
Explain promises as though you were mentoring a Code 301 level student
Are all callback functions considered to be Asynchronous? Why or Why Not?
Github view