function main() { SC.page.awake(); var arrayController = SC.ArrayController.create({ exampleContentObject: "SC.Record", commitChangesImmediately: YES, content: [], _contentObserver: function() { var len = this.get('content').get('length'); console.log('C1: [] observer:', this.get('content'), len); }.observes('[]') }); var arrayController2 = SC.ArrayController.create({ exampleContentObject: "SC.Record", commitChangesImmediately: YES, content: [], _contentObserver: function() { this._contentObserverWorker.bind(this).delay(0.001); }.observes('[]'), _contentObserverWorker: function() { var len = this.get('content').get('length'); console.log('C2: [] observer:', this.get('content'), len); } }); var arrayController3 = SC.ArrayController.create({ exampleContentObject: "SC.Record", commitChangesImmediately: YES, content: [], _contentObserver: function() { this._contentObserverWorker.bind(this).delay(0.2); }.observes('[]'), _contentObserverWorker: function() { var len = this.get('content').get('length'); console.log('C3: [] observer:', this.get('content'), len); } }); console.log("C1"); console.log("A is empty"); arrayController.pushObject({name: "Object1"}); console.log("A has one item"); arrayController.pushObject({name: "Object2"}); console.log("A has two items"); console.log("C2"); console.log("A is empty"); arrayController2.pushObject({name: "Object1"}); console.log("A has one item"); arrayController2.pushObject({name: "Object2"}); console.log("A has two items"); console.log("C3"); console.log("A is empty"); arrayController3.pushObject({name: "Object1"}); console.log("A has one item"); arrayController3.pushObject({name: "Object2"}); console.log("A has two items"); };