为了账号安全,请及时绑定邮箱和手机立即绑定

关于bind绑定函数缺省参数疑惑

关于bind绑定函数缺省参数疑惑

开心每一天1111 2018-09-13 14:30:04
控制台执行下面function getConfig(color,size,otherOptions){    console.log(color,size,otherOptions); }var defaultConfig = getConfig.bind("#FFF","20*12"); defaultConfig ('123')输出20*12 123 undefined请问输出的20*12 123 undefined是什么原理?为什么下面的语句正常输出function getConfig(color,size,otherOptions){    console.log(color,size,otherOptions); }var defaultConfig = getConfig.bind(null,"#FFF","20*12"); defaultConfig ('123')输出#FFF 20*12 123.bind第一个参数为null时,后面的参数为什么自动对应getConfig的前两个参数?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 660 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信