webveuje/考试/原题/js/前端js阶段性测验 .md
2021-04-29 17:16:40 +08:00

166 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 考试题目
## 填空
1. js由几部分组成 分别是
2. js数据类型中原始值与引用值的区别为
3. 将 "025.5" 的string类型变量转化为 number 类型后 值是什么?
4. 1 + 1aa 的运算结果是
5. 0 || 3 || 3 的返回结果是
6. 1 && 0 && 5 的返回结果是
7. 三种数据类型检测的方法
8. typeof 的返回值有
9. 列举几个与页面交互的函数
10. 列举操作数组的常用方法
## 简答
1. 定义一个数组[1,2,4,8,32] 计算所有数组元素的总和。
2. 定义一个方法 接受一个参数 计算从1 到传入数字的总和(累加)
3. 定义一个方法 接受一个参数 返回传入的参数是不是偶数 偶数返回 1 奇数返回 0
4. 某个公司采用公用电话传递数据,数据是四位的整数,在传递过程中是加密的,
加密规则如下每位数字都加上5,然后用除以10的余数代替该数字再将第一位和第四位交换
第二位和第三位交换,请编写一个函数,传入原文,输出密文
5. 写一个函数实现传入一个数组返回冒泡排序后的结果
6. 读代码 写出执行结果 并且分析原因
```
const pri=10
pri=8(pri)
```
```
var num=0
num++
console.log(++num)
```
```
var echo=function(e){
console.log("传入的值为"+e)
return
console.log("echo")
}
```
```
var a=0
while(a<5){
console.log(true)
}
```
```
function say(){
console.log(hello)
return
}
var word=say()
console.log(word)
```