1

Can someone explain me what does (callback[, thisObject]); mean in typescript documentation?

I'am more interested in bracets itself [, ].

ZiiMakc
  • 31,187
  • 24
  • 65
  • 105

1 Answers1

2

First of all, that's not the TypeScript documentation. This is.

Second, TypeScript doesn't introduce any functions, so to look up function definition, signatures, parameters and return types, you should go to the JavaScript documentation, here (specific documentation for .filter())

Having said all that, usually, in documentation and tutorials, square brackets around a parameter indicate that it's optional. callback is a parameter you must pass, but thisObject is not.

Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308