Angular - Lifecycle Hooks
Consider this Angular component snippet:
What will be logged if
items = [1, 2, 3];
ngDoCheck() {
if (this.items.length !== this.oldLength) {
console.log('Items changed');
this.oldLength = this.items.length;
}
}What will be logged if
items.push(4) is called and Angular runs change detection?