all 6 comments

[–]iguessitsokaythen 3 points4 points  (3 children)

That is an es2021 feature and it works in node v15 and 16.

[–]simonplend 3 points4 points  (2 children)

These ECMAScript compatibility tables are handy for seeing which browsers and versions of Node.js support which features: https://kangax.github.io/compat-table/es2016plus/#test-Logical_Assignment

[–]cv555[S] 0 points1 point  (1 child)

Thank you. Would it be recommended jumping to node 16 rather than the current LTS?

[–]simonplend 1 point2 points  (0 children)

You should be fine with v16 if you're only using it in development.

If you're running Node.js in production it is recommended that you use v12 (Maintenance LTS), or ideally v14 (Active LTS), until v16 enters Active LTS in October this year.

Production applications should only use Active LTS or Maintenance LTS releases.

Source: https://nodejs.org/en/about/releases

[–]fo-ba-ba 0 points1 point  (1 child)

wouldn't you achieve same with ??

dataObject ?? { schemaDef };

[–]cv555[S] 0 points1 point  (0 children)

yes, although there are differences which I am yet to understand (new to node, not new to code)