According to information from MDN:
The comma operator examines each of its components (working leftward) and gives back the outcome of the last one.
To experiment with this, I converted this arrow function:
const pushToArray = (a: FormArray, f: FormGroup) => {
a.push(f)
return a
}
into:
const pushToArray = (a: FormArray, f: FormGroup) => { a.push(f), a }
Unfortunately, it appears that it doesn't work as intended, resulting in:
TS2345 - The argument of type (a: FormArray, f: FormGroup) => void is not suitable ...
Why does the function now return void
? Could it be possible that I misunderstood the concept of evaluates each of its operands?