What does 'this.x1 = options.x1

Possible Duplicates:
What does "options = options || {}" mean in Javascript?
null coalescing operator for javascript?

Was reading some code and I saw this:

this.x1 = options.x1 || 0;

Never seen syntax like this before. What does it mean?


这是一个合并......这意味着如果options.x1是虚假的,它将分配0,否则就是options.x1。


Let this.x1 be the value of options.x1 if options.x1 has any truthy value. Otherwise let this.x1 be 0 .

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

上一篇: {}“

下一篇: 'this.x1 = options.x1是什么?