function testcall(){

 alert(this);

}

testcall.call('test', '')

testcall();               // test

call 把第一個參數當成this傳進去,之後的第二個參數是該function的參數

創作者介紹
創作者 程式筆記 的頭像
benjamin16pp

程式筆記

benjamin16pp 發表在 痞客邦 留言(0) 人氣( 6 )