---
title: "Comment by Lucas Giraldelli on \"New JavaScript Features ECMAScript 2021 (with examples)\" | Hashnode"
description: "I think the OR &amp; Equals (||=) after example is wrong. should be: let a = 1; a ||= 3 // Output: a = 3 Or I am wrong?"
url: "https://hashnode.com/posts/new-javascript-features-ecmascript-2021-with-examples/6088709bc5901d3a8711571d/comment/608962321bb72c581861fd16"
---

[Discussion](https://hashnode.com/posts/new-javascript-features-ecmascript-2021-with-examples/6088709bc5901d3a8711571d)

Comment [New JavaScript Features ECMAScript 2021 (with examples)](https://hashnode.com/posts/new-javascript-features-ecmascript-2021-with-examples/6088709bc5901d3a8711571d)

[Lucas Giraldelli](https://hashnode.com/@lucas-giraldelli)

[Apr 28, 2021](https://hashnode.com/posts/new-javascript-features-ecmascript-2021-with-examples/6088709bc5901d3a8711571d/comment/608962321bb72c581861fd16)

I think the OR & Equals (||=) after example is wrong.

should be:

let a = 1; a ||= 3

// Output: a = 3

Or I am wrong?

[Olivier Pons](https://hashnode.com/@olivierpons)

[Apr 28, 2021](https://hashnode.com/posts/new-javascript-features-ecmascript-2021-with-examples/6088709bc5901d3a8711571d/comment/608962321bb72c581861fd16#reply-608969c81bb72c581861fd9b)

He wrote twice "a &&= 3" for "&&=" but also for "||=" ;)

[Brayan Arrieta Alfaro](https://hashnode.com/@brayanarrieta)

[Apr 28, 2021](https://hashnode.com/posts/new-javascript-features-ecmascript-2021-with-examples/6088709bc5901d3a8711571d/comment/608962321bb72c581861fd16#reply-608970b71bb72c581861fe3a)

Checking thx for that I will check and correct that

[Brayan Arrieta Alfaro](https://hashnode.com/@brayanarrieta)

[Apr 28, 2021](https://hashnode.com/posts/new-javascript-features-ecmascript-2021-with-examples/6088709bc5901d3a8711571d/comment/608962321bb72c581861fd16#reply-608972421bb72c581861fe56)

I changed to

let a = 0; a ||= 3

// Output: a = 3

Basically the conditional apply with falsy values, thx [Lucas Giraldelli](https://hashnode.com/@lucas-giraldelli) [Olivier Pons](https://hashnode.com/@olivierpons)
