1

I found an assignment I don't understand. It mixes the logical AND operator && with an =:

x &&= y

What does it mean?

leonheess
  • 16,068
  • 14
  • 77
  • 112
  • 1
    https://github.com/tc39/proposal-logical-assignment/ – Bergi May 10 '21 at 14:14
  • 1
    @Bergi ty, I searched for a duplicate but couldn't find one. I moved my answer over there. – leonheess May 10 '21 at 14:18
  • 2
    Added the dupe to [What does this symbol mean in JavaScript?](https://stackoverflow.com/questions/9549780/what-does-this-symbol-mean-in-javascript) in case you ever need to find it again. (I wasn't able to find a dupe myself either.) – Ivar May 10 '21 at 14:23
  • 1
    @leonheess Thanks! I didn't realise this was meant to be a canonical question before I saw your edit to "*What does this symbol mean in JavaScript?*". The old one needs a bit cleanup, yours would be better phrased - but I don't think it matters enough to reverse the duplicate (or even merge them). – Bergi May 10 '21 at 14:24
  • @Bergi Agreed, I hope someone will find my answer helpful over there – leonheess May 10 '21 at 14:30

0 Answers0