I have a question why we need in this code return?

function showYourTask() {
// Don’t change code above this line
let dailyTask = ‘learn good variable naming conventions’;
let isDailyTaskComplete = true;
// Don’t change the code below this line
return {
dailyTask,
isDailyTaskComplete
};
}

I have a question why we need in this code return? Also why we dont use console.log to see what will be execute ?

Hi there!
In short, if you want just to check the value (e.g. for debugging), use console.log(), and if you want to store the value and work with it, use return.
I’ve explained the differences of these methods in more detail here:

Also you may find this guide helpful:

2 Likes