Somehow this code behave different result on tsc
and esbuild
.
$ node tsc-es2015.js
abc@abc.com
$ node tsc-esnext.js
abc@abc.com
$ node esbuild-es2015.js
abc@abc.com
$ node esbuild-esnext.js
undefined
- set
useDefineForClassFields
to false in tsconfig.json will solve the esbuild with esnext issue. - TypeScript: TSConfig Reference - useDefineForClassFields