I'm attempting to retrieve the total number of arrays of validators (e.g. 1038) from a JSON file using the code below, but it doesn't seem to be working as expected.
Can anyone spot what's wrong with my code?
let data = fetch("https://avax.dev/data/validators.json");
data
.then(response => response.json())
.then(data => {
console.log(data)
let count = Object.keys(validators).length;
console.log(count);
});