当前位置:网站首页>MDN文档里面入参写法中括号‘[]‘的作用
MDN文档里面入参写法中括号‘[]‘的作用
2022-04-23 05:37:00 【不知言】
查看MDN文档经常看到如下的写法:
Array.from(arrayLike[, mapFn[, thisArg]])
简单来说,中括号就是表示某个参数非必须,以上来说:
[, mapFn]即表示mapFn可选
[, thisArg]即表示thisArg可选
[, mapFn[, thisArg]]则表示thisArg是依赖于mapFn存在的,如果mapFn没有传值,那么thisArg是不可以传入的。
版权声明
本文为[不知言]所创,转载请带上原文链接,感谢
https://blog.csdn.net/WangYanWenXin/article/details/124344826
边栏推荐
- Golang通过exec模块实现Ping连通性检测案例
- Redis in node -- ioredis
- Edit, cancel, pull up menu
- Similarities and differences between vector and array (notes)
- JSON.
- Knowledge of egg testing -- mock, Supertest, coffee
- Pavlov and hobbies
- Excel sets row and column colors according to cell contents
- QSS, qdateedit, qcalendarwidget custom settings
- No.1.#_6 Navicat快捷键
猜你喜欢

3d slicer中拉直体的生成

Traversal array, object parent-child communication props / $emit

Cross platform packaging of QT packaging program

C, class library

Uncle wolf is looking for a translator -- Plato -- ongoing translation

Pol / select / EPO

Create a tabbar component under the components folder, which is public

C语言——恶搞关机小程序

Branch and loop statements

Flutter nouvelle génération de rendu graphique Impeller
随机推荐
windows连接mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)
使用宝塔+xdebug+vscode远程调试代码
C语言——恶搞关机小程序
Uncle wolf is looking for a translator -- Plato -- ongoing translation
xxl-job采坑指南xxl-rpc remoting error(connect timed out)
Relative reference and absolute reference of Excel
JSON.
STL learning notes 0x0001 (container classification)
qt. qpa. plugin: Could not find the Qt platform plugin “xcb“ in ““
3d slicer中拉直体的生成
Range of numbers (dichotomous classic template topic)
The prefix of static of egg can be modified, including boots
World and personal development
‘EddiesObservations‘ object has no attribute ‘filled‘
Arithmetic and logical operations
Three methods of list rendering
Formal parameters, local variables and local static variables
[untitled] Notepad content writing area
refused connection
Create process memory management copy_ Mm - processes and threads (IX)