2

Why are some js functions used with a window. prefix?
I mean I kinda get it when you want to addEventListener on the window but...
Why do people use window.setInterval?

Comments
  • 3
    Because window is the name of the object you're currently in, and setInterval is a method on that object
  • 1
    And why people use window.setInterval? No idea. Probably Java developers who like to be verbose about everything
Add Comment