获得过 0 次赞
回答过的问题获得 0 次赞
分享过的文章/案例获得 0 次赞
评论与回复获得 0 次赞
var format = function (account) { hello = 'hello1' } format() console.log(hello) //'hello1'
没有声明的变量直接赋值使用,会被定义为全局变量https://developers.weixin.qq.com/miniprogram/dev/reference/wxs/02variate.html 这里面有说到没有声明的变量直接赋值使用,会被定义为全局变量 我试了以下代码: var format = function (account) { hello = 'hello1' } console.log(hello) ide提示: VM3121:1 ReferenceError: hello is not defined 所以这句话,有问题吗?还是我理解错误了
2023-05-25