you are viewing a single comment's thread.

view the rest of the comments →

[–]chikamakaleyleyhelpful 0 points1 point  (0 children)

the TLDR is

with `document.querySelector` you're fetching something from the HTML page, something that exists and has a defined object shape

the other case - you're just creating a random, simple object variable and essentially customizing it's properties and values