I wrote a code to fetch an api in javascript but i also got the data back but i am not getting a desired output [duplicate]

For eg –

Const cities=[];

Fetch(api)
.then(response=>response.json())
.then(data=>cities.push(data)) 

I am not getting the desired Array,
I want an Array with the data but I am getting an array with length 1 and index element 0 and also getting the data at the 0th index but when I try to access it with cities[0] I get undefined can someone help me with that?