JavaScript—An Object‐Based Language
Jeremy McPeak, Paul Wilton · 2015
This chapter looks at a concept that is central to JavaScript, namely objects. It first explains the idea of what objects are and why they are important. The chapter moves on to discuss what kinds of objects are used in JavaScript, and shows how to create them and use them, and how they simplify many programming tasks for you. It talks about the most useful objects that JavaScript provides and explains how to use these in practical situations. The Math object provides a number of useful mathematical functions and a number manipulation methods. The Date object handles everything to do with date and time in JavaScript. The chapter explains how to create a Date object and some of its more commonly used methods. It highlights that JavaScript's real power comes from the fact that you can create your own objects to represent complex data.