[JavaScript] Deep Dive into Temporal Dead Zone (TDZ)
Introduction
Can you predict the output of these snippets of JavaScript code? Would the error occur?
const hyundai = new Car();
class Car {
constructor(color) {
this.color = color;
}
}
// Error or not?
myFunc();
function myFunc() {
conso...
jaylog.hashnode.dev4 min read