关卡详解
var k;
for(i=0, j=0; i<10, j<6; i++, j++){
k = i + j;
}
console.log(k);
var nums = [12,32,54,56,78,89];
for(var n in nums){
console.log(n);
}
function showCase(value) {
switch (value) {
case 'A':
console.log('Case A');
break;
case 'B':
console.log('Case B');
break;
case undefined:
console.log('undefined');
break;
default:
console.log('Do not know!');
}
}
showCase(new String('A'));
function showCase(value) {
switch (value) {
case 'A':
console.log('Case A');
case 'B':
console.log('Case B');
break;
case undefined:
console.log('undefined');
break;
default:
console.log('Do not know!');
}
}
showCase(String('A'));
var i = 0;
for (;;) {
if (i = 2) {
continue;
}
if (i > 20) {
break;
}
i++;
}
console.log(i);