-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab-6-journal
28 lines (25 loc) · 1.96 KB
/
lab-6-journal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Today I learned about DOMs and object methods. DOM stands for document object model which is like a layout of parent elements to children element and their children elements all connected like roots on a tree. I learned the 4 nodes that make a DOM are text,
attributes (which are pre-defined extra meta information for elements. Example is using <img src=“google.com/images”> this is a self closing tag and “src=google.com/images” is the attribute), elements (which are the important components for a mark-up like <p> <h1> <footer> <title> etc.), and documents which are the parent element in creating an html mark up like an outline, or storing data, creating a thesis for a website/browser.
I learned a bit more about object literals and got to work with them a bit. Here is an example I wrote in my notes...
notice how the “;” are replaced with “,” and “=“ replaced with “:” when properties are stored within curly brackets in the example below...
var emptyObj = { }; // empty object
var person = {
age: 35,
name: ‘scott’,
children: [‘bill’, stella’, ‘laura’ ],
};
properties are data stored within the curly brackets of an object
object are key values of variable and value within like the ‘person’ variable above holding so many key values (aka properties) is the object
I learned a bit about object methods with the example Scott used in lecture...
var turtle = {
name: Leo,
speed: 3,
color: blue,
breed: sea,
doesSwim: true,
sayHello: function () {
console.log(‘Hello my name is’, + turtle.name );
},
};
I learned that a method is a function that belongs to an object. We got to practice this in lab 6, although I'm still struggling a bit trying to wrap my head around it.
I learned that an Object oriented model (OOM) is the construction of objects using a collection of objects that contain stored values of the instance variables found within an object. Unlike models that are record-oriented, object-oriented values are solely objects.