福州海康笔试
海康威视 福州业务
多选
seo优化
大题(手写代码)
1.使用flex实现
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {
padding: 0;
margin: 0;
text-align: center;
}
header,
footer {
width: 100%;
background-color: #f00;
line-height: 48px;
}
main {
width: 100%;
line-height: 500px;
display: flex;
}
.aside {
width: 480px;
background-color: #ff0;
}
.content {
width: 100%;
background-color: #0ff;
}
</style>
</head>
<body>
<header>header</header>
<main>
<div class="aside">aside</div>
<div class="content">content</div>
<div class="aside">aside</div>
</main>
<footer>footer</footer>
</body>
</html>
现有函数
function red(){console.log('red')}
function green(){console.log('green')}
function yellow(){console.log('yellow')}
代码
function red() { console.log('red') } function green() { console.log('green') } function yellow() { console.log('yellow') } function redP() { return new Promise(function(resolve, reject) { red(); setTimeout(function() { resolve(greenP()) }, 3000); }) } function greenP() { return new Promise(function(resolve, reject) { green(); setTimeout(function() { resolve(yellowP()) }, 1000); }) } function yellowP() { return new Promise(function(resolve, reject) { yellow(); setTimeout(function() { resolve(redP()) }, 2000); }) } redP();3.写一个防抖