reading-notes

Problem Domain, Objects, and the DOM

JavaScript Object Basics

  1. How would you describe an object to a non-technical friend you grew up with?

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.

  1. What are some advantages to creating object literals?

  2. How do objects differ from arrays?

  3. Give an example for when you would need to use bracket notation to access an object’s property instead of dot notation.

  4. 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 `);
  }
}

Introduction To The DOM

  1. What is the DOM?

  2. Briefly describe the relationship between the DOM and JavaScript.

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?

Things I want to know more about