diff --git a/content/lessons/js3/sublesson/promises.mdx b/content/lessons/js3/sublesson/promises.mdx index 4c935fdede..c9d1360af3 100644 --- a/content/lessons/js3/sublesson/promises.mdx +++ b/content/lessons/js3/sublesson/promises.mdx @@ -1036,12 +1036,8 @@ const fs = require('fs') request('https://pokeapi.co/api/v2/pokemon/', (err, res, body) => { const parsedJson = JSON.parse(body) - const nameArray = [] - parsedJson.results.forEach(thisPokemon => { - nameArray.push(thisPokemon.name) - }) - const names = nameArray.reduce((acc, thisName) => { - return `${acc}

${thisName}

` + const names = parsedJson.results.reduce((acc, pokemon) => { + return `${acc}

${pokemon.name}

` }, '') fs.writeFile('names.html', names, () => {}) }) @@ -1871,7 +1867,7 @@ The responses are raw, in chat format. const titles = data.reduce((acc, f) => { return `${acc}

${f.title}

` }, '') - fs.writeFile('title.html', titles, () => {}) + fs.writeFile('lessons.html', titles, () => {}) }) ```