<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>bind的使用方法</title> </head> <body> <script> //bind方法使用案列 function A(){ console.log('----------'); return this; } function B(){ var obj = { name:'hello word', parm:arguments || null } return obj; } function C(parm){ var b = B(parm); return A.bind(b,null); } //调用 var c = C([1,2,3])(); for(i in c){ if(typeof c[i] == 'object'){ for(var j in c[i]){ console.log(c[i][j]) } }else{ console.log(c[i]) } } </script> </body> </html>