My code is as follows:
//fetch tasks from server
const fetchTasks=()=>{
const fTask = async ()=>{
const res = await fetch('http://localhost:5000/tasks')
const data = await res.json()
console.log("data", data)
}
fTask()
}
fetchTasks()
I was expecting the data to be logged into the console only once, but for some reason, it is being logged twice. I tried debugger, but it too did not help.. thank you in advance..