4.3. Invocation

Invoking a function suspends the execution of the current function, passing control and parameters to the new function. In addition to the declared parameters, every function receives two additional parameters: this and arguments. The this parameter is very important in object oriented programming, and its value is determined by the invocation pattern. There are four patterns of invocation in JavaScript: the method invocation pattern, the function invocation pattern, the constructor invocation pattern, and the apply invocation pattern. The patterns differ in how the bonus parameter this is initialized.

The invocation operator is a pair of parentheses that follow any expression that produces a function value. The parentheses can contain zero or more expressions, separated by commas. Each expression produces one argument value. Each of the argument values will be assigned to the function's parameter names. There is no runtime error when the number of arguments and the number of parameters do not match. If there are too many argument values, the extra argument values will be ignored. If there are too few argument values, the undefined value will be substituted for the missing values. There is no type checking on the argument values: any type of value can be passed to any parameter.

最新文章

  1. Lucene 单域多条件查询
  2. Git命令
  3. 一步一步实战扩展 ASP.NET Route,实现小写 URL、个性化 URL
  4. Qt创建窗体的过程
  5. HDU -1284钱币兑换
  6. TP框架多表联查
  7. back_inserter的用法
  8. web中的简单全选反选
  9. C# 合并、拆分PPT幻灯片
  10. 三种方法实现调用Restful接口
  11. Kubernetes---存储
  12. C#设计模式之十外观模式(Facade Pattern)【结构型】
  13. 怎么自行HTTP的POST包头,需要使用json
  14. springboot linux启动方式
  15. BZOJ 4159 [Neerc2009]Business Center
  16. 关于POD和非POD类型中,list initialization和constructor initialization(未解决)
  17. (简单匹配)Card Game Cheater -- hdu --1528
  18. 使用JavaScript实现ajax
  19. TeamViewer 说明截图
  20. JDBC的基础接口及其用法

热门文章

  1. iOS UI布局总结
  2. openssl 下的对称加密和非对称加密
  3. Java之三大基础排序(冒泡、选择、插入)
  4. <MyBatis>入门七 缓存机制
  5. 每日命令:(5)rm
  6. OS X中微信双开
  7. BZOJ 3648 寝室管理
  8. 处理回车提交、ctrl+enter和shift+enter都不提交->textarea正常换行
  9. 【Codeforces 1009D】Relatively Prime Graph
  10. 零基础到架构师 不花钱学JavaEE(基础篇)- 概述