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

return a;为什么不能写成document.write(a); document.write 是不是只能输出被赋值的变量?

return a;

document.write(a);

有什么区别?

document.write 是不是只能输出被赋值的变量?

正在回答

1 回答

document.write是在界面上显示出来,return是函数的返回值,document.write 只能输出被赋值的变量,如果没有被赋值那它会输出undefined


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

return a;为什么不能写成document.write(a); document.write 是不是只能输出被赋值的变量?

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号