Code Fellows Reading Notes

DOM

What is the DOM? Document Object Model is the API used to interact with the elements of an HTML page.

Briefly describe the relationship between the DOM and JavaScript. JavaScript uses the DOM to select, interact, and alter elements contained in the HTML.

JavaScript Objects

How would you describe an object to a non-technical friend you grew up with? An object is a group of key value pairs that allows you to save any type of information youd like as a value, and access that information using the key name.

What are some advantages to creating object literals? Object literals are created by writing out the propers when insantiating it, rather than creating it with a class.

How do objects differ from arrays? You access values using an index in an array, whereas you use property names to access values in an object.

Give an example for when you would need to use bracket notation to access an object’s property instead of dot notation. Bracket notation allows you to access a variable when referencing a value, dot notation does not allow this.

Evaluate the code below. What does the term this refer to and what is the advantage to using this? Using the this keyword allows you to access the property of the specific object you are working with.