you are viewing a single comment's thread
view the rest of the comments
[–] 10 points 2 years ago (5 children)

Yea uh is this actually equivalent? In all of those other cases you're checking if a is null and in the last case my understanding is it is checking to see if a is falsely. In the case that a is 0, or undefined, or an empty array or any other kind of non null falsey value, then the behavior would be different.

  • source
  • hideshow 5 child comments
  • [–] 21 points 2 years ago (3 children)

    In C# that last one is the null propagation operator. If a is not null then a, else b.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 7 points 2 years ago (2 children)

    Ah interesting one of those cases where this could be one of a few languages. I was reading it as JS.

  • source
  • parent
  • hideshow 2 child comments