JavaScript基础考核真题——你能全做对吗?

时间:2022-05-03
本文章向大家介绍JavaScript基础考核真题——你能全做对吗?,主要内容包括1、输出结果是多少?(1分,第一小题0.6分,第二小题0.4分)、1、2、2、几道题的输出结果分别是多少?(1.25分,每小题0.25分)、2、2、2、3、2、4、2、5、3、基本数据类型的专业术语以及单词拼写(0.25分)、4、变量的命名规范以及命名推荐(1分)、5、三种弹窗的单词以及三种弹窗的功能(0.5分)、6、console.log( 8 | 1 ); 输出值是多少?(0.25分)、7、输出结果分别是多少?(0.75分,每小题0.25分)、7、2、7、3、基本概念、基础应用、原理机制和需要注意的事项等,并结合实例形式分析了其使用技巧,希望通过本文能帮助到大家理解应用这部分内容。

正文

JavaScript基础考核真题——你能全做对吗。刘国利 - 独行冰海 : 每位讲师在授课、管理的同时,还需要不断的涉猎各种知识,提升本职技术。本文章的考题是对讲师的JavaScript基础进行了检测,即便是基础,也不能忽视了,大家可以来尝试一下哦~

1、输出结果是多少?(1分,第一小题0.6分,第二小题0.4分)

1、1

var a;
var b = a * 0;
if (b == b) {
    console.log(b * 2 + "2" - 0 + 4);
} else {
    console.log(!b * 2 + "2" - 0 + 4);
}

1、2

<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>

2、几道题的输出结果分别是多少?(1.25分,每小题0.25分)

2、1

function test(test){
    test = 10;
    var test = test;
    test++;
}test(5);
console.log(test);

2、2

var t = 10;
function test(t){
    var t = t++;
}test(t);
console.log(t);

2、3

var t = 10;
function test(test){
    var t = test++;
}test(t);
console.log(t);

2、4

var t = 10;
function test(test){
    t = test++;
}test(t);
console.log(t);

2、5

var t = 10;
function test(test){
    t = t + test;
    console.log(t);
    var t = 3;
}test(t);
console.log(t);

3、基本数据类型的专业术语以及单词拼写(0.25分)

4、变量的命名规范以及命名推荐(1分)

5、三种弹窗的单词以及三种弹窗的功能(0.5分)

6、console.log( 8 | 1 ); 输出值是多少?(0.25分)

7、输出结果分别是多少?(0.75分,每小题0.25分)

7、1

<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>

7、2

var a;
var b = a / 0;
if (b == b) {
    console.log(b * 2 + "2" - 0 + 4);
} else {
    console.log(!b * 2 + "2" - 0 + 4);
}

7、3

<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>