
上QQ阅读APP看书,第一时间看更新
No prototype object
Arrow functions do not have prototype objects, hence, they are not constructor functions. And they cannot be invoked with a new operator. An error will be thrown if you try that. Here's an example:
const WorkoutPlan = () => {};
// Uncaught TypeError: WorkoutPlan is not a constructor
let workoutPlan = new WorkoutPlan();
console.log(WorkoutPlan.prototype); // undefined