An object in code to be the “idea” of and object all of the abstract things we attach to them. Take a can of Coke as an example: it has properties like filled
, red
, sugary
, brown
, etc. We can also DO things with the can. we can open()
, drink()
, and even crush()
the can. The properties and things we do with the can are similar to attributes and functions in programming.
What are some advantages to creating object literals?
How do objects differ from arrays?
Give an example for when you would need to use bracket notation to access an object’s property instead of dot notation.
Evaluate the code below. What does the term this refer to and what is the advantage to using this?
const dog = {
name: 'Spot',
age: 2,
color: 'white with black spots',
humanAge: function (){
console.log(` ${this.name} is ${this.age*7} in human years `);
}
}
What is the DOM?
Briefly describe the relationship between the DOM and JavaScript.
Understanding the problem domain is the hardest part of programming
What’s the difference between primitive values and object references in JavaScript?