对于带参数的函数:
function displayCouplet(var couplet) {
document.write(couplet);
}
displayCouplet("The object of my worship lies beyond perception's reach,For men who see, the Ka'aba is a compass, nothing more.");
显示错误Uncaught SyntaxError: Unexpected token var。这是为什么 ?如果我从参数中省略了关键字var
,那么一切正常。请解释这是为什么?