Project/progress updates!
JavaScript Object Basics
1) An object is similar to an empty skeleton or shell where related data and functionality are grouped together.
2) Object literal is just a list (separated by comma) of the key value pair inside the brackets. It’s useful to use object literal if you want to transfer or move a collectino of data, instead of moving each data piecewise.
3) Object is similar to an array, but to access the members in the object, the faux indices can be directly retrieved by name, instead of a numerical indices. Arrays store data in a single variable, whereas an object can store a collection of data.
4) The bracket notation is used when to access the value when the key is an actual variable.
5) Keyword this
is used to refer to the an object that is running the current function. If humanAge property is retrieved, the object this
is referring to the object dog
’s name and color (Spot and ‘white with black spots’), which is the current object running the humanAge function.
Introduction to the DOM
1) The DOM (Document Object Model) is the representation of a page as a collection of objects and nodes so programs can manipulate the document structure, style and content.
2) JS is the script that uses the DOM to make changes to the page. JS will make the changes to the DOM, and then the DOM will be rendered by Web API to build the page viewed by the uswer.
I would like to understand how the DOM is constructed by various Web APIs. I caught glimpss of xml being used with Python in some example.