let api = "https://randomuser.me/api/";function fetchData() { fetch(api) .then(response => response.json()) .then(data => { console.log(data); })}fetchData();
let api = "https://randomuser.me/api/";function fetchData() { fetch(api) .then(response => response.json()) .then(data => { console.log(data); })}fetchData();
I'm workig with a sample RandomUser API. When running this code, it returns this object (see img #1). I'm attempting to retreive the data within 'results'. Creating a variable like
let result = data.result
let result = data.result
returns (see img #2). But, when I try to log the gender, but calling