let x;
x ??= 'abc'
console.log(x); // abc
Running the code above in the browser console does not cause any issues.
However, when attempting to run it in TypeScript, an error is thrown.
SyntaxError: Unexpected token '??='
Here is my current setup:
"typescript": "^4.1.3",
"webpack": "^5.11.0",
"webpack-cli": "^4.2.0"
"target": "ESNext",
"module": "ESNext",
If I want to utilize the "??=" operator, do I need to make changes in webpack or tsconfig? Thank you!