const res3 = await fetch(url2, { method: "GET", header: { Accept: "application/json", "Content-Type": "application/json", }, }) .then((response) => response.json()) .then((data) => { console.log("Success:", data); }) .catch((err) => console.log("thown error-->" + err)); console.log(res3); const response=await res3.json() //erroneous line console.log(response);aquí se imprime res3 = indefinido
y cuando se ejecuta el siguiente código
const res3 = await fetch(url2, { method: "GET", header: { Accept: "application/json", "Content-Type": "application/json", }, }); const response=await res3.json() console.log(response);respuesta = [objeto, Objeto] se imprime en la consola
y cuando intente acceder a la respuesta como response.obj donde el backend devuelve la respuesta como: res.json({ obj:data, msg:"Success" })