I have come across a particular javascript code while looking into RxJs documentation.
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
map(x => x * x)(of(1, 2, 3)).subscribe((v) => console.log(`value: ${v}`));
I understand what it does but I have not come across this syntax before as far as I remember. Which syntax is this?
EDIT:
I was confused about the part map(x => x * x)(of(1, 2, 3)). @Olian04 nicely explains that map() is an higher order function. map() returns an function which is passed the parameter of(1, 2, 3)