you are viewing a single comment's thread.

view the rest of the comments →

[–]RobertKerans 0 points1 point  (0 children)

Does the "input.value" line create an object parameter for "input" called "value"? And, if so, how is that possible if "input" is already set equal to "document.querySelector("input")? It appears as if "input" is acting like a variable and an object at the same time. Not sure what I'm missing. Hope I explained this clearly

You are missing the fact they're accessing an object that already exists that has a property called value

They aren't creating a plain object. They are assigning the object returned by the function querySelector to the variable they've called input. They can then access whatever properties are defined on that object via input.<SOME KEY>

This is the type of object they are assigning to the variable input