I am using ngOnChanges and I've set the SimpleChange parameter as below. Why is it that I can directly access my input property using changes.currentValue without having to get the property using indexing? Both work and I'm confused as to why?
ngOnChanges(changes: SimpleChange) {
console.log('ngOnChanges called with changes value: ', changes.currentValue) // why does this work? is it because by convention it works if I have just one input property??
for (const propName in changes) {
console.log('ngOnChanges called with propName value: ', changes[propName].currentValue)
}
}