Short answer:
console because you can't return from a promise function (except using then)
console.log(matchList.players.filter(player => player.id === userid)[0])
Long answer: if you execute this code in your console it will console the information for:
1- EspartaN
2- Elsa
async function showMatch(idOfSpecificUser) {
// idOfSpecificUser: the id of the user you want his/her information
// make the GET request
let response = await fetch(`https://api.myjson.com/bins/1e96uo`);
// convert the response to JSON
let responseToJson = await response.json();
// take the players array from the response after convert it to JSON
let playersArrayOfObject = responseToJson.players;
// console.log(playersArrayOfObject); // => [ {}, {}, {}, ... ]
// now the real fun start
// you need to iterate over this array and get the user data
// why [0] cause filter return to you array of object (we need the first match)
// or the only one match // => [ {id: 71471603, username: "EspartaN", .....} ]
let userInfo = playersArrayOfObject.filter(
user => user.id === idOfSpecificUser
)[0];
console.log(userInfo.username); //=> "EspartaN"
console.log(userInfo); // => { id: 71471603, username: "EspartaN", ..... }
}
// => "EspartaN"
showMatch(71471603);
// => "Elsa"
showMatch(97531);
If you need any explanation, or this is not what you are asking about, please comment on my answer