From the course: JavaScript Essential Training

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Global objects

Global objects

- [Instructor] In addition to the objects you build yourself, either directly or through a class or a constructor, the browser has a long list of default objects you can use for a variety of different purposes. A full list of all of these global objects it's available and extensively documented in the MDN Web Docs. These global objects work exactly like the object we've seen so far except, we don't need to define them, they're just available through the browser, and for the most part we interact with them through their methods. Let me give you an example of how these global objects are used, with the help of the date object that you see here. I want to extend my Backpack class an object type with a new property called dateAcquired, so I know when I got the backpack, and I can do some math to figure out how old that backpack is. Adding the new property is straightforward now that we know how the object and the class works.…

Contents