正文
JavaScript基础考核真题——你能全做对吗。刘国利 - 独行冰海 : 每位讲师在授课、管理的同时,还需要不断的涉猎各种知识,提升本职技术。本文章的考题是对讲师的JavaScript基础进行了检测,即便是基础,也不能忽视了,大家可以来尝试一下哦~
var a;
var b = a * 0;
if (b == b) {
console.log(b * 2 + "2" - 0 + 4);
} else {
console.log(!b * 2 + "2" - 0 + 4);
}
<script>
var a = 1;
</script>
<script>
var a;
var b = a * 0;
if (b == b) {
console.log(b * 2 + "2" - 0 + 4);
} else {
console.log(!b * 2 + "2" - 0 + 4);
}
</script>
function test(test){
test = 10;
var test = test;
test++;
}test(5);
console.log(test);
var t = 10;
function test(t){
var t = t++;
}test(t);
console.log(t);
var t = 10;
function test(test){
var t = test++;
}test(t);
console.log(t);
var t = 10;
function test(test){
t = test++;
}test(t);
console.log(t);
var t = 10;
function test(test){
t = t + test;
console.log(t);
var t = 3;
}test(t);
console.log(t);
<script>
var a = 1;
</script>
<script>
var a;
var b = a / 0;
if (b == b) {
console.log(b * 2 + "2" - 0 + 4);
} else {
console.log(!b * 2 + "2" - 0 + 4);
}
</script>
var a;
var b = a / 0;
if (b == b) {
console.log(b * 2 + "2" - 0 + 4);
} else {
console.log(!b * 2 + "2" - 0 + 4);
}
<script>
var a = 1;
</script>
<script>
var a;
var b = a / 0;
if (b == b) {
console.log(b * 2 + "2" + 4);
} else {
console.log(!b * 2 + "2" + 4);
}
</script>