📜  js竖线符号有什么作用 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:22.734000             🧑  作者: Mango

代码示例1
( 3|0 )                        === 3;
( 3.3|0 )                      === 3;
( 3.8|0 )                      === 3;
( -3.3|0 )                     === -3;
( -3.8|0 )                     === -3;
( "3"|0 )                      === 3;
( "3.8"|0 )                    === 3;
( "-3.8"|0 )                   === -3;
( NaN|0 )                      === 0;
( Infinity|0 )                 === 0;   
( -Infinity|0 )                === 0;     
( null|0 )                     === 0;          
( (void 0)|0 )                 === 0;      
( []|0 )                       === 0;            
( [3]|0 )                      === 3;           
( [-3.8]|0 )                   === -3;       
( [" -3.8 "]|0 )               === -3;   
( [-3.8, 22]|0 )               === 0     
( {}|0 )                       === 0;            
( {'2':'3'}|0 )                === 0;     
( (function(){})|0 )           === 0;
( (function(){ return 3;})|0 ) === 0;