Abstract Data Types (ADT)
Numbers and booleans are what we call a primitive data type while Arrays, Strings, or the Math object in JavaScript are way more complex - we call those Abstract.
Let's learn how to declare something more custom than a number. Take a look at this simple example of creating a variable that has a name and a boolean for on or off:
let light_switch = {
name: "Living Room",
state: "off",
change_state: function() {
if (this.state == "on")
this.state == "off";
else
this.state == "on";
}
};
That allows us to keep track of the name of the switch and the status of it, all in one variable, named light_switch.