Multiple choice javascript

When authoring web page with Javascript, why should you explicitly include the window object into your codes?

  1. this is a good practice

  2. this is REQUIRED

  3. this ensures browser compatibility

  4. this ensures OS compatibility

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

While the 'window' object is the global scope in browser-based JavaScript and its properties can be accessed without the prefix, explicitly including it is considered good practice for code clarity and avoiding naming collisions. It is not strictly required for compatibility or execution.