标签:index indexof 特性 some 整数 trunc clu mat 判断
~运算的使用-num-1即~1=>-2 ~-1=>0NaN被当作0来运算所以
!!~string.indexOf("something")等价于string.includes("something")
~~更加容易被用到
~~运算会得到运算数的整数部分~~3.14 => 3 ~~-3.14 => -3 ~~NaN => 0 ~~-0 => 0Math.trunc()的唯一不同点是Math.trunc(NaN) => NaN Math.trunc(-0) => -0标签:index indexof 特性 some 整数 trunc clu mat 判断
原文地址:https://www.cnblogs.com/shaddollxz/p/14902600.html