caller和callee的解析与使用-型参与实参的访问
caller:是一个函数引用(当前执行函数”被调用的地方”{即这个”被调用的地方”函数引用},如果这个”被调用的地方”是window,则返回【null】),是函数名的属性;
var a = function() {
alert(a.caller); //输出:var b = function() {a();}
}
var b = function() {
a();
}
b();
callee:返回当前执行函数本身,是arguments的属性。
var a = function() {
alert(arguments.callee); //输出:function() {alert(arguments.callee);}
}
型参与实参的访问
function fn(a,b,c){
console.log(fn.length); //型参:输出3
console.log(arguments.callee.length); //型参:输出3 【匿名函数的用法】
console.log(arguments.length); //实参:输出2
}
fn(1,2);
参考来源:http://blog.csdn.net/laijieyao/article/details/43404953
caller和callee的解析与使用-型参与实参的访问的更多相关文章
- js中的caller和callee属性
caller返回一个对函数的引用,该函数调用了当前函数. functionName.caller functionName 对象是所执行函数的名称. 说明对于函数来说,caller 属性只有在函数执行 ...
- JavaScript方法call、apply、caller、callee、bind的使用详解及区别
一.call 方法 调用一个对象的一个方法,以另一个对象替换当前对象(其实就是更改对象的内部指针,即改变对象的this指向的内容). 即 “某个方法”当做“指定的某个对象”的“方法”被执行. Js代 ...
- caller和callee
我们先来看下caller. caller:返回一个对函数(该函数调用了当前函数)的引用. functionName.caller:functionName对象是所执行函数的名称. 说明 对于函数来说, ...
- js- caller、 callee
caller 返回一个对函数的引用,该函数调用了当前函数. functionName.caller functionName对象 是所执行函数的名称. 说明 对于函数来说 ...
- arguments.callee 属性 递归调用 & caller和callee的区别
arguments.callee 在函数内部,有两个特殊的对象:arguments 和 this.其中, arguments 的主要用途是保存函数参数, 但这个对象还有一个名叫 callee 的属 ...
- js中caller和callee属性详解
一.caller属性返回一个对函数的引用,该函数调用了当前函数.functionName.callerfunctionName 对象是所执行函数的名称.说明对于函数来说,caller 属性只有在函数执 ...
- arguments.callee 调用自身 caller,callee,apply and call
一.Arguments该对象代表正在执行的函数和调用他的函数的参数.[function.]arguments[n]参数function :选项.当前正在执行的 Function 对象的名字.n :选项 ...
- caller.arguments.callee.eval
------------------------------------ 1.函数的调用方式,与this的指向问题,原型对象中的this 2.对象创建的几种方式! 3.str.replace 页面初始 ...
- Js中caller和callee的区别
1 :caller 返回一个调用当前函数的引用 如果是由顶层调用的话 则返回null (举个栗子哈 caller给你打电话的人 谁给你打电话了 谁调用了你 很显然是下面a函数的执行 只有在打电话的时 ...
随机推荐
- EasyIPCamera通过RTSP协议接入海康、大华等摄像机,摒弃私有SDK接入弊端
本文转自博客:http://blog.csdn.net/xinlanbobo/article/details/53156742 近期工作中需要开发一套视频监控系统,实现WEB端.手机APP端预览局域网 ...
- gdb coredump的使用
1 出现core dump时最好的办法是使用gdb查看coredump文件 2 使用的条件 出现问题的代码,系统,所有涉及的代码都应该一起编译,然后得到符号表,这样加载符号表,使用coredump文件 ...
- Package md5 implements the MD5 hash algorithm as defined in RFC 1321 base64
https://golang.google.cn/pkg/crypto/md5/ Go by Example 中文:Base64编码 https://books.studygolang.com/gob ...
- Dropout: A Simple Way to Prevent Neural Networks fromOverfitting
https://www.cs.toronto.edu/~hinton/absps/JMLRdropout.pdf Deep neural nets with a large number of par ...
- three supported reliability levels: * End-to-end * Store on failure * Best effort
https://github.com/cloudera/flume/blob/master/flume-docs/src/docs/UserGuide/Introduction === Reliabi ...
- FireMonkey下的WndProc实现
unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Types, System.UI ...
- linux环境下启动tomcat7出现时间过长(已经编译完成的项目)问题解决!
已经编译完成的项目,系统启动过程中,提示: INFO: Starting Servlet Engine: Apache Tomcat/7.0.81 Sep 20, 2017 3:17:32 PM or ...
- linux定期判断网站可否打开
wget http://www.shopindream.de/200.php --timeout=2 c_monitor=$? rm -rf 200.php if [ ! $c_monitor = ...
- Android Studio 模拟器无法打开 emulator: ERROR: x86 emulation currently requires hardware
首先要打开SDK的下载位置,找到以下陌路: android-sdk\extras\intel\Hardware_Accelerated_Execution_Manager\IntelHaxm.exe ...
- cassandra 存储二进制data
Blob type The Cassandra blob data type represents a constant hexadecimal number defined as 0[xX](hex ...