I'm struggling to understand the difference between defining a property inside vs outside the constructor. In the below example both properties are accessible on the instance in the same way, what is the difference?
class Foo {
constructor() {
this.bar = 1;
}
baz = 1;
}
const foo = new Foo();
console.log(foo.bar, foo.baz); // 1 1