Junior JavaScript

What is the difference between class and function constructor?

Feature Function Constructor Class

Syntax function Person(){} class Person{}

Hoisting Yes, function declarations are

hoisted

No, classes are not

hoisted

new

required

Recommended Required

More from JavaScript Tutorial

All questions for this course