-1

I have absolutely no idea how this is called which is the reason why my searches failed miserably.

What does this code mean

var a = b || c;

I believe it's something like a will equal which ever is defined but.. I just have to be sure what it exactly does before I use it.

php_nub_qq
  • 13,981
  • 19
  • 68
  • 133
  • 1
    It is a boolean OR operation, a way you could search for it is "javascript double pipe operation", just for future reference :) – Hanuman Jul 31 '14 at 21:23
  • Yes, this is one of the things I wanted to find out, asking this question, thank you! – php_nub_qq Jul 31 '14 at 21:25

1 Answers1

2

If b is defined, it will use b, if c is defined and b isn't, it will use c. If you put it in parenthesis () it will return true/false.

Blake A. Nichols
  • 855
  • 1
  • 6
  • 10