摆烂好久决定把之前面的发一下,上来就做题,三道题,做完没有反问就拜拜,已收到感谢信
9.21号 一面
1.
tree = [
{ name: 'A' },
{
name: 'B', children: [
{ name: 'A' },
{name:'AA',children:[{name:'AAA'}]}
]
},
{name:'C'}
]
// 1.假设我输入的str为A, 则过滤后返回的结果为
[
{ name: 'A' },
{name:'B',children:[{name:'A'}]}
]
//2.假设我输入的str为AA,则过滤后返回的结果为
[
{
name: 'B', children: [
{name:'AA',children:[{name:'AAA'}]}
]}
]
//3.假设我输入的str为B,则过滤后返回的结果为
[
{
name: 'B', children: [
{ name: 'A' },
{name:'AA',children:[{name:'AAA'}]}
]}
]
2.
//?位置应该怎么写才能输出true
var a = ?
console.log(a==1&&a==2&&a==4)//true
3.
var F = function(){};
Object.prototype.a = function(){console.log('a')};
Function.prototype.b = function(){console.log('b')};
var f = new F();
f.a()
f.b()
//问:f.a()和f.b()分别打印什么
//写出函数的原型链调用
#深信服##前端##秋招##面经#