function Person(name, age){
this.name = name;
}
Person.prototype.sayHello = function(){
console.log("Hello, my name is ${this.name}");
}
const person1 = new Person("Alice", 30);
person1.sayHello()
class Person {
constructor(name, age){
this.name = name;
this.age = age;
}
sayHello(){
console.log("Hello, my name is ${this.name}");
}
}
const person1 = new Person("bob", 25);
person1.sayHello();
1.flex布局实现垂直置顶,靠右对齐
2.align-content和align-self的区别
const squareArrow = x => x *x;
})
链式调用
错误处理
优势:
6.看一道promise代码输出题(涉及微任务和宏任务)
7.写两道题,一道正则,一道时间戳转年月日
8.封装一个通用的fetch请求
9.说说es6的class和构造函数
9.手写一个react手动计数组件
10.点击一个button,另一个button也计数怎么实现
11.实习中哪里用到了状态提升
状态提升是一种数据流管理技术,用于在组件中共享状态。当多个组件需要访问和修改同一个状态时,将状态提升到这些组件的最近共同父组件中,然后通过props将状态和用于修改状态的函数传递到需要他们的子组建中
function Form(){ const [inputValue, setInputValue] = useState("");
}
function InputComponent({value, onChange}){ return ; }
13.函数式组件怎么暴露自己的数据和方法给父组件使用