I get data from the database with Sveltekit and nodejs and always fetching data like that
...responseData = await response.json();
It returns Object and I can assign it to an array
let getData = [];getData = responseData ;
What makes me confused is why the returned JSON Object display at console have the bracket which should be an array.(but it is Object checking with typeof)
[ {a:1,b:1}, {a:2,b:2},]
What i expect of a JSON Object should look like{"name":"John", "age":30, "car":null}
and why the JSON Object can be assigned to an array directly?
I guess I have some misunderstanding about these data types.