I look at these lines of code from here :
if (callback) callback(sig || graph);
I have never seen vertical "or" stripes in a javascript method call. What do they mean? Do they pass a “true” parameter (ie whitefish or graph)? Do they pass a specific parameter? I have never seen this syntax before.
JS ( ). 11.11. , , . , ToBoolean 9.2, [null, undefined, 0, ''] .
[null, undefined, 0, '']
, JS , , . SO, , true false. .
(||) - , , . "" - 0, undefined, null, "" false.
||
0
undefined
null
""
false
, , , . AND (&&), : false, , .
&&
, , sig, .
sig
'or' (http://www.w3schools.com/js/js_comparisons.asp) , (sig OR graph)
, "" , . :
If (foo || foo2)
foo , JavaScript foo2 , .
(||) , true, True .
True
:
var x = 8;
var y = 'c';
x> = 8 || === ''
True - False. , True.
False
|| OR.
, .