美文网首页
面试字节

面试字节

作者: kzc爱吃梨 | 来源:发表于2020-05-11 17:58 被阅读0次
function Person(name) {
  this.name = name;
}

Person.prototype.print = function() {
  return this.name;
};

Person('abc');
const a = new Person('abc').print.call({});
console.log(a);

const fn = () => {
  this.x = 'z';
};

const b = {x: 'y'};
fn.call(b);
console.log(b);

2.垂直居中

function Person(name) {
  this.name = name;
}

Person.prototype.print = function() {
  return this.name;
};

Person('abc');
const a = new Person('abc').print.call({});
console.log(a);

const fn = () => {
  this.x = 'z';
};

const b = {x: 'y'};
fn.call(b);
console.log(b);
flat 

[1,2,3,4,[5,6,7,[8,9]]]

[1,2,3,4,5,6,7,8,9]

function flat(arr) {
 return result 
}

5.Promise

相关文章

网友评论

      本文标题:面试字节

      本文链接:https://www.haomeiwen.com/subject/chhqnhtx.html