js中!和!!的區別及用法

js中!的用法是比較靈活的,它除了作邏輯運算經常會用!作類型判斷,能夠用!與上對象來求得一個布爾值,html 一、!可將變量轉換成boolean類型,null、undefined和空字符串取反都爲true其他都爲false。post  !null=truehtm  !undefined=true對象  !''=trueblog  !100=false字符串  !'abc'=falseclass  
相關文章
相關標籤/搜索