其實是一種利用符號進行的類型轉換,轉換成數字類型~~true == 1~~false == 0~~"" == 0~~[] == 0~~undefined ==0~~!undefined == 1~~null == 0~~!null == 1 ...
其實是一種利用符號進行的類型轉換,轉換成數字類型
~~true == 1
~~false == 0
~~"" == 0
~~[] == 0
~~undefined ==0
~~!undefined == 1
~~null == 0
~~!null == 1