rustyBucketBay
rustyBucketBay

Reputation: 4551

Logical nullish assignment. Unexpected token '??='

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

Answers (1)

Majed Badawi
Majed Badawi

Reputation: 28434

According to the documentation, Logical nullish assignment is available for Node.js 15.0.0

Upvotes: 6

Related Questions