Chapter 9: https://codepen.io/Jiayue-Qiu/pen/bGzwdLw
Coding exercise:
https://github.com/CallieQ/front_end_web/tree/main/assignment 8
Learning log:
In class:
Object.assign()
class
Array.prototype.reduce()
Thejsway:
class MyClass {
constructor(param1, param2, ...) {
this.property1 = param1;
this.property2 = param2;
}
method1() **{;}
**method2() {;}
// ...
}
The map()
, filter()
and reduce()
methods can replace loops for array traversal and let you program with arrays in a functional way.
nodeType
returns node type
childNodes
contains child nodes
parentNode
returns parent node
getElementsByTagName()
search items by tag(list)
getElementsByClassName()
search items by class(list) ****
getElementById()
search item by ID(1)