function make () {
return ()=>{
console.log(this);
}
}
const testFunc = make.call({ name:'foo' });
testFunc(); //=> { name:'foo' }
testFunc.call({ name:'bar' }); //=> { name:'foo' }
function foo() {
setTimeout( () => {
console.log("args:", arguments);
},100);
}
foo( 2, 4, 6, 8 );
// args: [2, 4, 6, 8]
function make () {
var self = this;
return function () {
console.log(self);
}
}
function make () {
return function () {
console.log(this);
}.bind(this);
}
function make () {
return ()=>{
console.log(this);
console.log(arguments);
}
}
//babel it...
function make() {
var _this = this,
_arguments = arguments;
return function () {
console.log(_this);
console.log(_arguments);
};
}
const testFunc = (...args)=>{
console.log(args) //数组形式输出参数
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有