KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Looking at an online source code I came across this at the top of several source files. var FOO = FOO || {}; FOO.Bar = …; But I have no idea what || {} does. I know {} is equal to new Object() and I think the || is for something like "if it already exists use its value else use the new object. Why would I see this at the top of a source file?
Tags (comma-separated)
Save Edits
Cancel