前端面试基础题

基础题


1、常用的js定义类的方法,继承的方法有哪些?
2、this在不同的情况下会指向不同的内容,请举例。
3、Apple call bind的用途与区别
4、definePropety、proxy都是做什么用的。
5、什么是闭包,举个例子;
6、举例 字符串 和 数组 常用哪些方法;
7、可用于js的设计模式,如工厂模式、代理模式、装饰模式、观察者模式。
8、reactJS的生命周期函数有哪些。
9、使用webpack搭建项目。
10、异步回掉 可以用什么方法写成同步代码?
11、Html5有哪些新特性?
12、cookie、localStorage、sessionStorage的区别
13、css隐藏元素有哪些方法。
14、css 居中方法 垂直与水平
15、css的盒模型(标准盒模型、怪异(ie)盒模型、可伸缩(flex)盒模型)
16、css选择器有哪些?css3新增特性有哪些?
17、数组去重的方法,手写代码。

const arr = ['1', '1', 1, undefined, undefined, 3, 10, 3]

// es6
let newArr = [...new Set(arr)]
let newArr = Array.from(new Set(arr))

// 利用数组的indexOf下标属性查询
function unique(arr) {
	let newArr = []
	for(let i=0; i<arr.length; i++) {
		if (newArr.indexof(arr[i]) === -1) {
			newArr.push(arr[i])
		}
	}
	return newArr
}

// 利用数组原型对象上的includes方法
function unique(arr) {
	let newArr = []
	for (let i=0; i<arr.length; i++) {
		if (!newArr.includes(arr[i])) {
			newArr.push(arr[i])
		}
	}
	return newArr
}

// 将元素组排序,相邻的进行比较
function unique(arr) {
	let fromArr = arr.sort()
	let newArr = [fromArr[0]]
	for (let i=1; i<arr.length; i++) {
		if (arr[i] !== arr[i-1]) {
			newArr.push(arr[i])
		}
	}
	return newArr
}

18、v-on可以绑定多个指令吗?(可以)
19、vue有哪些指令,并做简单说明
20、
null == null / true
null === null / true
null == undefined / true
null === undefined / false
undefined == undefined / true
undefined === undefined / true

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值