说说CSS的position属性
说说box-sizing
<!DOCTYPE html>
<html>
<head>
<style>
.box {
width: 10px;
height: 10px;
border: 1px solid red;
margin: 2px;
padding: 2px;
background: blue;
}
#borderBox {
box-sizing: border-box;
}
#contentBox {
box-sizing: content-box;
}
</style>
</head>
<body>
<div>请问下面两个 div 元素,蓝色区域的宽高各是多少像素?</div>
<div id="borderBox" class="box"></div>
<div id="contentBox" class="box"></div>
</body>
</html>
垂直居中几种方式
行内垂直居中
__proto__
js基本数据类型
JS如何判断一个对象是数组
说出下面代码的结果
window.name = 'ByteDance'; function A () {
this.name = 123;
}
A.prototype.getA = function(){
console.log(this);
return this.name + 1;
} let a = new A(); let funcA = a.getA;
funcA();console的this指向谁
funcA return值
let funcA = a.getA;bind call apply
window.name = 'ByteDance'; class A {
constructor() {
this.name = 123;
}
getA() {
console.log(this);
return this.name + 1;
}
} let a = new A(); let funcA = a.getA;
funcA();
setInterval
console.log('begin')
setTimeout(() => {
console.log('setTimeout 1')
Promise.resolve().then(() => {
console.log('promise 1')
setTimeout(() => {
console.log('setTimeout2 between promise1&2')
})
}).then(() => {
console.log('promise 2')
})
}, 0) console.log('end')
TCP和UDP的区别
Headers的内容有哪些
编程题1
比较两个版本号 version1 和 version2。
如果 version1 > version2 返回 1,如果 version1 < version2 返回 -1, 除此之外返回 0。
你可以假设版本字符串非空,并且只包含数字和 . 字符。
. 字符不代表小数点,而是用于分隔数字序列。
例如,2.5 不是“两个半”,也不是“差一半到三”,而是第二版中的第五个小版本。
你可以假设版本号的每一级的默认修订版号为 0。例如,版本号 3.4 的第一级(大版本)和第二级(小版本)修订号分别为 3 和 4。其第三级和第四级修订号均为 0。
const v1 = '1.2.3'
const v2 = '2.3.4'
function compare(v1, v2)
示例 1:
输入: version1 = "0.1", version2 = "1.1"
输出: -1
示例 2:
输入: version1 = "1.0.1", version2 = "1"
输出: 1
示例 3:
输入: version1 = "7.5.2.4", version2 = "7.5.3"
输出: -1
示例 4:
输入:version1 = "1.01", version2 = "1.001"
输出:0
解释:忽略前导零,“01” 和 “001” 表示相同的数字 “1”。
示例 5:
输入:version1 = "1.0", version2 = "1.0.0"
输出:0
解释:version1 没有第三级修订号,这意味着它的第三级修订号默认为 “0”。
v2 = '1.1.1.1.1'
v1 = '1.1'
说说canvas
编程题2
二分查找 ,查找数组中的 6。 ARRAY = [1 ,2, 8, 9, 6, 19, 99, 12]
编程题3
写一个归并排序
编程题4
子串串匹配
String A = "12ddd"
String B ="12hhh"
当前字符串的公共子串“12”
String A = "12ddd"
String B ="12hhh12ddd"
当前字符串的公共子串“12ddd”
编程题5
描述
给定一个有向图,图节点的拓扑排序定义如下:
- 对于图中的每一条有向边 A -> B , 在拓扑排序中A一定在B之前.
- 拓扑排序中的第一个节点可以是图中的任何一个没有其他节点指向它的节点.
针对给定的有向图找到任意一种拓扑排序的顺序.
DAG