I am reading a book about Angular but I can't find any documentation about this brackets usage for the lambda expression [hours, rate]) => this.total = hours * rate
. Although I understand that I can use these parameters (hours and rate) from inside the body of the lambda expression. I don't understand why this (hours, rate) => this.total = hours * rate)
doesn't work and why do I have to use the brackets [].
Observable.combineLatest(this.invoiceForm.get('hours').valueChanges,
this.invoiceForm.get('rate').valueChanges).subscribe(
([hours, rate]) => this.total = hours * rate);
Can somebody explain me what it means and where I can find documentation about that usage.
Note: I know what combineLatest does what I don't understand is the lambda expression usage with those brackets.