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
.
上一篇: {}“