亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

這里打印的arguments為啥是null?

這里打印的arguments為啥是null?

MMMHUHU 2018-09-11 14:10:08
var a=3,b=4;function h(a,b){return a+b};console.dir(h)function h(a.b)arguments: null  這個為啥是nullcaller: nulllength: 2name: "h"prototype:Object__proto__: function()<function scope>
查看完整描述

1 回答

?
叮當貓咪

TA貢獻1776條經驗 獲得超12個贊

function abc(x,y,z){ return arguments;};

console.dir(abc);

/*

abc(x, y, z)

arguments: null //沒調用時沒有

caller: null

length: 3  //如果要獲取參數個數,應該用 length

name: "abc"

prototype: abc__proto__: ()<function scope>

*/


console.dir(abc(1,2,3));

/*

[1, 2, 3]

0: 1

1: 2

2: 3

callee: abc(x,y,z)

length: 3

*/


查看完整回答
反對 回復 2018-10-11
  • 1 回答
  • 0 關注
  • 1110 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號