A constructor in JavaScript is a function that is called with the “new” operator.