How to get data of the users from received array using fetch () | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

How to get data of the users from received array using fetch ()

Hi Everyone! Please I need your help! The task is following. 1.Get the data of all users using fetch is done. 2.Output the lastnames of all users. 3.Output the users whose last name begins with F. Requirements. The data can be retrieved once. Items 2-3 can be done in one place, the output is devided by console.log('-----')console.log('Item 1'). The problem is the following. I am trying to implement each item in a separate async function. Can't fulfill the second, third items. How to refer to array received by the first function? https://code.sololearn.com/Wkf6DveA0BUq/?ref=app

24th Nov 2021, 5:01 PM
Elena
Elena - avatar
5 Answers
+ 2
https://code.sololearn.com/WdR67AYRWMEU/?ref=app
24th Nov 2021, 8:47 PM
JaScript
JaScript - avatar
+ 2
If you wanna do it with 3 async calls (don't really know why): https://code.sololearn.com/WH5XnUZBVJm7/?ref=app
24th Nov 2021, 8:59 PM
Artur
Artur - avatar
+ 2
Thanks a lot, Artur, the code is well stuctured, cool! 😊 Спасибо огромное!
25th Nov 2021, 6:09 AM
Elena
Elena - avatar
0
Why you return console.log() on first function? You should return the array of lastnames.
24th Nov 2021, 8:48 PM
Artur
Artur - avatar
0
You're welcome :)
25th Nov 2021, 6:32 AM
Artur
Artur - avatar