0

I'm not sure about the meaning of this expression :

var Ajax = Ajax || {};

I think its create a new object if not exists, but I 'm not sure

afsdi3
  • 37
  • 1
  • 6
  • Possible duplicate of [Javascript Question Mark & Double Pipes](https://stackoverflow.com/questions/26636653/javascript-question-mark-double-pipes) – Baris Demiray Jun 08 '18 at 09:37
  • 4
    Possible duplicate of [JavaScript OR (||) variable assignment explanation](https://stackoverflow.com/questions/2100758/javascript-or-variable-assignment-explanation) – rick Jun 08 '18 at 09:37
  • 1
    You are correct, it creates a new Ajax object if it does not yet exist. – Lain Jun 08 '18 at 09:37

1 Answers1

0

It assigns {} to Ajax if Ajax doesn't yet exist, else it Ajax keeps its value.

Ivan
  • 34,531
  • 8
  • 55
  • 100
theCoder
  • 24
  • 3