Running a code like that results in inconsistent logging:
const d = document.createElement('div');
console.log(d);
setTimeout(() => {
const d = document.createElement('div');
console.log(d);
});
Result:
As you can see, the first one is printed as an object, and the second one is printed as an HTML element.
Related question - Always reveal html element in console.log (Chromium)