标签:顺序 ret 题集 cti test var cond turn nbsp
1.
function() {
var a = 10;
if(a > 5) {
a = 7;
}
alert(a);
}
2.
function() {
if(true) {
var a = 5;
}
alert(a);
}
3.
var a = 5;
function first() {
a = 6;
}
function second() {
alert(a);
}
按顺序执行函数。
4.
var a = 5;
function() {
var a = 7;
alert(a);
}
5.
var a = 6;
function test() {
var a = 7;
function again() {
var a = 8;
alert(a); // First
}
again();
alert(a); // Second
}
test();
?alert(a);? // Third
6.
function getFunc() {
var a = 7;
return function(b) {
alert(a+b);
}
}
var f = getFunc();
f(5);
标签:顺序 ret 题集 cti test var cond turn nbsp
原文地址:http://www.cnblogs.com/tong24/p/7305692.html