Object prototypes
Reference types vs primitive types
Array iteration methods
2. Approaching Objects and Arrays
3. Objects and Properties
2. Approaching Objects and Arrays
ความแตกต่างระหว่าง prototype vs class
mean that objects เป็น reference types ?
Array function
Arrays เป็น objects
Course overview
-vanilla javascript
Javascript – support class , แต่ไม่ได้เป็น natural state เพราะ js เริ่มต้นเป็น prototype-based langauge
3. Objects and Properties
What is an Object ?
3 อย่างเกี่ยวกับ object in js
1. Containers for other datatyes
user เป็น object, และในนั้น มี id , username , timezone คลุมเป็น encapsulate
ในแต่ละอัน เช่น id – มี number , username – string , timezone -string, อันนี้คือ properties
2. Passed via reference
เปรียบเทียบ primary object , ถ้าใช้ cons name = false ,เมื่อใช้งาน boolean ก็จะชี้ไปที่ false
แต่ถ้าเป็น object มันไม่มีตัวprototype ที่ทำไว้ก่อน จึงต้องชี้ไป reference
3. object link กับ prototype
Creating object
