Javascript面试题
基本类型•
- undefined
- null
- boolean
- number
- string
- symbol
- bigint
引用类型•
array
object
function
regexp
date
内置的对象•
String(常用)
Boolean
Number
Array(常用)
Object
Function
Math(常用)
Date(常用)
RegExp
数组•
push()
pop()
sort()
splice()
join()
map()
filter()
reduce()
concat()
reverse()
类型判断•
typeof():判断基本类型
instanceof():判断引用类型
清除数组中的重复元素•
使用
Set
1 | const array = [1, 2, 2, 3, 4, 4, 5] |
1 | const array = [1, 2, 2, 3, 4, 4, 5] |
使用
filter和indexOf
1 | const array = [1, 2, 2, 3, 4, 4, 5] |
使用
reduce
1 | const array = [1, 2, 2, 3, 4, 4, 5] |
Lodash库
1 | import _ from "lodash" |
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 许可协议。转载请注明来自 kaze-log!
评论






