When I ask AI to write a script to use in a fibery automation, it ALWAYS, like 100% of the cases, uses OptionalChaining, and then I have to explain not to use that.
Please:
Options to Enable Optional Chaining:
- Upgrade JavaScript version to ES2020 or higher (this enables native support for optional chaining).
- Configure Babel with the plugin
@babel/plugin-proposal-optional-chaining
(if using Babel to transpile the code). - Upgrade TypeScript to target ES2020 or higher (in
tsconfig.json
) to enable optional chaining. - Use a polyfill (if targeting older environments that do not support optional chaining natively).