Reading
An object, in coding terms, is like a box. The only thing you put in this box is specific information or data. For example if you are making a box for personel information maybe you have a piece of paper that has the information you want stored such as first name, last name, birthday, and what their favorite dinosaur is, but you can also have a list of all their favorite foods on there too. Then you put it in the box so that you can reference the information later.
They are easy to reference and work with using simple syntax. They are easier to work with than a bunch of single items or even an array.
It’s a dfferent referencing system, instead of using an index number you call it something and then reference it by name.
“…if an object property name is held in a variable, then you can’t use dot notation to access the value, but you can access the value using bracket notation.” https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics
const dog = {
name: ‘Spot’,
age: 2,
color: ‘white with black spots’,
humanAge: function (){
console.log(${this.name} is ${this.age*7} in human years
);
}
}
“this” is used as an immediate reference point to whatever the item is (ie: name, age) within the system of the object. It tells the code to only search among the box of the object. The “this” makes it so that you can go within many objects and pull out that same specific information respective to each without having to write code specific to each object, instead one line can be universal to all.
“The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document.”
The HTML DOM is a standard object model and programming interface for HTML. It defines:
- The HTML elements as objects
- The properties of all HTML elements
- The methods to access all HTML elements
- The events for all HTML elements In other words: The HTML DOM is a standard for how to get, change, add, or delete HTML elements.
https://www.w3schools.com/js/js_htmldom.asp
JavaScript is a language and the document object model is a book? The language can also be used in other contexts like being spoken, however, when it exsists in a book it has a certain set of rules and behavior guidelines regarding how it is written and read.
Bookmark and Review
Understanding the problem domain is the hardest part of programming
What’s the difference between primitive values and object references in JavaScript?
===> So these last two aren’t questions, and one isn’t even a link to anything. I’m just gonna turn this in and read the remaining link then.