Reputation: 4551
I'm running this code with node.js:
const tasksSorted = {};
tasksSorted[0] ??= {};
Which I believe its valid. I get the error:
tasksSorted[0] ??= {};
^^^
SyntaxError: Unexpected token '??='
In the browser I can use the ??=
Logical nullish assignment
Upvotes: 2
Views: 1591
Reputation: 28434
According to the documentation, Logical nullish assignment
is available for Node.js 15.0.0
Upvotes: 6