{}" in Javascript

This question already has an answer here:

  • What does “options = options || {}” mean in Javascript? [duplicate] 5 answers
  • What does “var FOO = FOO || {}” (assign a variable or an empty object to that variable) mean in Javascript? 7 answers

  • In browsers, the window object is global.

    If $N is falsy, {} will be assigned to window.$N . If $N is truthy, its value will be assigned to window.$N (keeping the same value probably).

    This is a common way to override default values.

    链接地址: http://www.djcxy.com/p/95292.html

    上一篇: Javascript对象创建?

    下一篇: {}“