今天很残酷,明天更残酷,后天很美好,但是绝大数人都死在了明天晚上,看不到后天的太阳。加油!
考试时间:2020年9月24日7:00 时常90分钟(够用的)
考试题型:单选20个 不定项10个 编程2个(编程文档编辑器手写)
一、选择题考点
1. http协议头部cache-control
2. CSS隐藏元素的方法和区别
3. 前端离线存储的方式(cookie, localstorage, sessionstorage, IndexedDB, Web SQL, Database, FileSystem)
4. 产生BFC的几种方式
- 根元素
- float属性不为none
- position为absolute或fixed
- display为inline-block, table-cell, table-caption, flex, inline-flex
- overflow不为visible
5. 使用媒体查询(media queries)方式
(1)link元素中的CSS媒体查询
<link rel = "stylesheet" media ="screen and (max-width:600px)" href="./css/blue.css">
(2)样式表中的CSS媒体查询
<style>
@media (max-width:600px){ .facet_sidebar{display:none}}
</style>
6. React生命周期方法
7. 浏览器的userAgent可以获得哪些信息
8. http协议的request method的值
9. 独立作用域
10.CSS继承属性
11. css属性可以使用负值
12. 对象的不可枚举属性和可枚举属性
13. CSS级联顺序
14. HTML全局属性
15. JS异步执行
16. 可以作为变量名(考点保留字)
二、编程题
1. 数组中重复最多次数的数
function findMost (arr) {
if (!arr.length) return;
if (arr.length === 1) return 1;
let maxName, maxNum = 0
let res = arr.reduce((res, currentNum) => {
res[currentNum] ? res[currentNum] += 1 : res[currentNum] = 1
if (res[currentNum] > maxNum) {
maxNum = res[currentNum]
maxName = currentNum
}
return res
}, {})
return '出现次数最多的元素为:' + maxName + ', 出现次数为:' + maxNum;
}
参考链接:https://juejin.im/post/6844903795957170183
2. 网页中实现一个计算当前年还剩下多少时间的倒计时。显示“XX年还剩XX天XX时XX分XX秒”
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>TEst</title>
</head>
<body>
<span id="target"></span>
<script type="text/javascript">
// 为了简化。每月默认30天
function getTimeString() {
var start = new Date();
//new Date(1,0,1)这三个参数是年月天
var end = new Date(start.getFullYear() + 1, 0, 1);
var elapse = Math.floor((end - start) / 1000);
var seconds = elapse % 60 ;
var minutes = Math.floor(elapse / 60) % 60;
var hours = Math.floor(elapse / (60 * 60)) % 24;
var days = Math.floor(elapse / (60 * 60 * 24)) % 30;
var months = Math.floor(elapse / (60 * 60 * 24 * 30)) % 12;
var years = Math.floor(elapse / (60 * 60 * 24 * 30 * 12));
return start.getFullYear() + '年还剩' + years + '年' + months + '月' + days + '日'
+ hours + '小时' + minutes + '分' + seconds + '秒';
}
var target = document.getElementById('target');
setInterval(function () {
domText(target, getTimeString());
}, 1000)
</script>
</body>
</html>
参考链接:https://blog.csdn.net/qq_18663357/article/details/52268036?utm_source=blogxgwz6