Ask coding questions

← Back to all posts
Why is `searchQuery` is equal to `[object Window]`?
RixTheTyrunt

When you open Ifcurs, it shows a new tab. But, when you search, the title changes to "Ifcurs Search - " + searchQuery, and, it means Ifcurs Search - [object Window]. Can you explain why?

Answered by SixBeeps [earned 5 cycles]
View Answer
Voters
RixTheTyrunt
Comments
hotnewtop
SixBeeps

Take a guess at what this means.

RixTheTyrunt

But this works, right?

RixTheTyrunt

I mean the code

RixTheTyrunt

:D

SixBeeps

@RixTheTyrunt What are you trying to achieve with this line of code?

this in this context refers to the object running the script, which happens to be the window in this case.

RixTheTyrunt

I fixed that "this" thing

ch1ck3n

@RixTheTyrunt dude you dont have to send 3 billion replies to convey just one message. just stick with one