genkid2020

Untitled

Aug 9th, 2020
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. for (var page=1;page<=25;page++){
  2. fetch(`https://api.hh.ru/vacancies?page=${page}`)
  3. .then(res => res.text())
  4. .then(body => {
  5. const data = JSON.parse(body);
  6. const output = data.items.map(({id, name, snippet}) => ({
  7. id,
  8. name,
  9. snippet
  10. }));
  11. console.log(output);
  12. });}
Add Comment
Please, Sign In to add comment