【2022】58同城前端笔试

58同城前端笔试单选题

1. 以下代码输出

console.log([1,2,3,4,5].splice(1,2,3,4,5));
console.log([1,2,3,4,5].slice(1,2,3,4,5));

[2,3]和[2]

2. 求root元素的高 (通过getComputedStyle(root).height计算) 为?

<html>
<body>
<div id="root" style="border:1px solid red;">
    <div style="width:10px;height:10px;margin:10px;"></div>
    <div style="width:10px;height:10px;margin:20px;"></div>
</div>
</body>
</html>

70px

3. 假定某次上线,1小时内出bug的概率为50%,那么3小时内出bug的概率是?

87.5%

4. 以下代码执行返回?

parseInt('0x111')

273

5. 下边关于https描述正确的是:

客户端会对服务器下发的证书进行域名校验

6. 下边关于XSS描述正确的是

XSS攻击需要也服务器对接口进行防护

7. 以下运行结果:?

for(var i = 0; i < 10; i++) {
    setTimeout(function() {
        console.log(i);
    }, 1000);
}

10个10

8. 在跨域请求中,下列请求头中哪种content-type一定会触发cors预检查?

application/json

9. 下面代码输出结果正确的是?

function Setcount(count){
this.count=count
}

Setcount.prototype.printCount=function(){
console.log(this.count)
}

let a = new Setcount(100)
a.count =200
a.__proto__.count=300
a.__proto__.printCount()
a.printCount()

300,200

10. 关于position定位,下列说法正确的是

z-index属性对元素position属性为relative,absolute, fixed都可以做层级设置

11. 请选择console打印的正确值?

Object.prototype.foo = 'Object';
Function.prototype.foo = 'Function';
function Animal () {};
var cat = new Animal();
console.log(cat.foo);
console.log(Animal.foo);

Object Function

12. 请选择正确的输出结果?

var bar = [1,2,3]; for(var i in bar) {
	setTimeout(function(){console.log(bar[i])},0);
		console.log(bar[i]);
}

123和333

大厂真题 & 高级前端进阶

2023年前端面试真题汇总-持续更新中 先收藏慢慢看!(Vue 小程序 css ES6 React 校招大厂真题、高级前端进阶等)

小米秋招面试题(卷1+卷2)

B站前端笔试题(卷1)

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我只会写Bug啊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值