Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Works! The double pipes line basically means, create a new array if it doesn't exist yet, and avoids having to use an if() statement? Never seen that before, thanks. Commented Sep 2, 2013 at 12:49
  • Double pipes line is the logical OR operator [developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…. This usage is a common way to provide defaults. Use with care though, because any falsy value will be overwritten with the default, not just undefined or null. In this case you have no worries, because arrays are always truthy. Commented Sep 2, 2013 at 12:54
  • I knew double pipes = OR, just wondering what it meant in this context. Thanks again for your help. Commented Sep 2, 2013 at 12:58