首页
搜索
导航
登录
特效
代码
工具
留言
教程
题库
题分类
网址箱
您的位置:
首页
-
题库
-
JavaScript题目
以下代码最后一句alert的输出结果是( )
var msg='hello';
for (var i=0; i<10; i++)
{
var msg='hello'+i*2+i;
}
alert(msg);
A、hello
B、hello27
C、hello30
D、hello189
上一题
下一题
返回列表
查看答案
解析
重置
参考答案:
d/D
这里的for循环不是函数,
因此for内部定义的msg与for外部定义的msg为在同一块作用域,为同一个变量。
'hello'+9*2+9
输出hello189
收藏
列表
评论:
导航
返回顶部