Factory & Constructor Functions
What will be logged by this code?
function Car(make) {
this.make = make;
}
const car = Car('Toyota');
console.log(car?.make);
console.log(window.make);
function Car(make) {
this.make = make;
}
const car = Car('Toyota');
console.log(car?.make);
console.log(window.make);