Today this caught my attention on jQuery's API Documentation for the
.closest( selector [, context ] )
What exactly does
[, context] mean? I know I can put a variable or jQuery object there to set as the context. This itself isn't entirely clear to me, but the part in particular I'm asking about today is the square bracket comma (
[, ). What does this mean? I've also seen similar notation on php.net's manual pages.
bool ob_start ([ callable $output_callback [, int $chunk_size = 0 [, ...
Is there some preliminary lesson I've missed? because this is greek to me and I can't be the only one who's looked at this and thought "WTF..." but ignored it and went on guessing, when I could have saved a lot of time...
It means that parameter is optional. You don't have to provide it and if you don't it will use the value you see listed there by default.