reading-notes

class-07 summary

Domain Modeling

var parkourFail = new EpicFailVideo(7, false); var corgiFail = new EpicFailVideo(4, true);

console.log(parkourFail); console.log(corgiFail);

JS Functions, Methods, and Objects:

user.displayInfo = function(){ console.log(My ${user.name} i live in in ${user.location} and am ${user.age} years old); }; user.displayInfo(); //Output:

  1. DOCUMENT OBJECT MODEL : uses objects to create a representation of the current page. It creates a new object for each element (and each individual section of text) within the page. image
  2. GLOBAL JAVASCRIPT OBJECTS : represent things that the JavaScript language needs to create a model of. For example, there is an object that deals only with dates and times. image
    • Each character in a string is automatically given a number, called an index number. Index numbers always start at zero and not one (just like for items in an array). image
    • In JavaScript there are six data types: Five of them are described as simple (or primitive) data types (String / Number/ Boolean/Undefined (a variable that has been declared, but no value has been assigned to it yet) and Null (a variable with no value - it may have had one at some point, but no longer has a value)). The sixth is the object (and is referred to as a complex data type).
    • GLOBAL OBJECTS: NUMBER OBJECT: Whenever you have a value that is a number, you can use the methods and properties of the Number object on it. image