Mobafire LoL Builds

FREEMIUM
Door Slimjim2448 | Bijgewerkt לפני חודשיים | Gaming
Populariteit

0.3 / 10

Latency

805ms

Serviceniveau

0%

Health Check

N/A

Terug naar alle discussies

Result grows after each GET

Rapid account: Abrowncownow
abrowncownow
לפני שנתיים

I was just testing this on a basic level. Each time I run the fetch request, my array grows. it started with <200 results and now I’m over 5000. It isn’t a local problem, because when I change the variable, the result is the same (huge fetch return). How/Why am I getting a larger request each time. I would like the id-list data that I pull to remain the same .length
Here is my very simple code:

const options = {
    method: "GET",
    headers: {
        "X-RapidAPI-Key": "{myapikey}",
        "X-RapidAPI-Host": "mobafire-lol-builds.p.rapidapi.com",
    },
};

var ChampId = [];
function getChampList(){
    fetch(
        "https://mobafire-lol-builds.p.rapidapi.com/api/champions/id-list",
        options
    )
        .then((response) => response.json())
        .then(function (data) {            
            ChampId = data;
						 // Use the console to examine the response
            console.log(ChampId);
        });
}

getChampList();

Doe mee aan de discussie - voeg hieronder een opmerking toe

Log in / Schrij u in om nieuwe opmerkingen te plaatsen