0
What is the specialty of self
, a global property that refers to the global object itself?
console.log(self === this, this.self === this,
window.self === this, self.self === this);
0
What is the specialty of self
, a global property that refers to the global object itself?
console.log(self === this, this.self === this,
window.self === this, self.self === this);
1
According to MDN the 'self' notation alone is useful when working with web Workers. I know my answer is not very detailed, but I believe this link will put you on the right track.
https://developer.mozilla.org/en-US/docs/Web/API/Window/self
ps: I was just going to comment, but I still don’t have enough reputation.
That’s the kind of answer I was hoping for. I just can’t figure out why it’s useful in relation to the Workers web.
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.
Hello Matheus, just your question being older I ended up answering in this Javascript - Difference between `this` and `self` so I’m voting as dup.
– Guilherme Nascimento