这在文档中是什么意思:方括号后跟逗号([,] [英] What does this mean in documentation: square bracket followed by comma ( [, )

查看:110
本文介绍了这在文档中是什么意思:方括号后跟逗号([,]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我引起了我对 jQuery的API文档的关注,最近 / code> selector:

Today this caught my attention on jQuery's API Documentation for the closest selector:

.closest( selector [, context ] )

[,context] 是什么意思?我知道我可以把一个变量或者jQuery对象放在上面来设置。这本身并不完全清楚,,但是我特别在今天询问的部分是方括号逗号( [, 。这是什么意思?我也在 php.net的手册页上看到了类似的符号。 / p>

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 [, ...

我错过了一些初步教训,因为这是希腊给我,我不能是唯一一个看这个并认为WTF ...,但忽略它,并且猜测,当我可以节省很多时间...

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.

这篇关于这在文档中是什么意思:方括号后跟逗号([,]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆