Slide 41
Slide 41 text
Object.observe
var todos = ["eat","code","code","sleep"];
// Using Array.observe
Array.observe(todos,function(changes) { console.log(changes); })
todos.pop() // sleep
// ࢹ͍ͯ͠ΔΦϒδΣΫτͷԿ͕ߋ৽͞Εͨͷ͔͕͔Δ
// [ { type: 'splice',
// object: [ 'eat', 'code', 'code' ],
// index: 3,
// removed: [ 'sleep' ],
// addedCount: 0 } ]