I was reading some code written several months ago by another fellow and I found this declaration/assignation in ngOnInit function, from a service that is being injected on the constructor.
constructor(private _authService: AuthService) { }
ngOnInit() {
const { _authService } = this;
}
What's the point of using const and assigning to the service that is being injected the this keyword? I wasn't able to find any similar question. I also looked at the TypeScript documentation without finding anything useful.
this._authService, although I couldn't tell you why. It's not really TypeScript- or Angular-related, just general JS destructuring.