Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: とは !! JavaScript の演算子?
私はこれを数回見たことがあります:)
function foo(){ return !!(window.history); }
ブール型を強制するために使用されると思います...
例えば
if("true" == true){ alert("1"); }else{ if(!!"true" == true){ alert("2"); } }
アラート 2 ではなく 1
[そうではない]暗黙的に値をブール型にキャストしていたと思います