1function A() {
2 this.val = "Error";
3 (function() {
4 this.val = "Success";
5 })();
6}
7
8function B() {
9 this.val = "Error";
10 (() => {
11 this.val = "Success";
12 })();
13}
14
15var a = new A();
16var b = new B();
17a.val // "Error"
18b.val // "Success"