Javascript: How is self used?

Asked

Viewed 224 times

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 answer

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

You are not signed in. Login or sign up in order to post.