Logical nullish assignment (??=) gives an error in Visual Studio Code

Logical nullish assignment is giving SyntaxError: Unexpected token '??=' in the Visual Studio Code. Is there any solution for this error?

I am trying this code;

const a = { duration: 50 };

a.duration ??= 10;
console.log(a.duration);
// expected output: 50

a.speed ??= 25;
console.log(a.speed);
// expected output: 25

13 thoughts on “Logical nullish assignment (??=) gives an error in Visual Studio Code”

  1. 739806 244449The the next occasion I read a weblog, I genuinely hope so it doesnt disappoint me around brussels. Come on, man, Yes, it was my option to read, but I just thought youd have some thing intriguing to state. All I hear can be plenty of whining about something which you could fix in the event you werent too busy looking for attention. 827739

    Reply