js邏輯與、或、非運算規則

與&&和||不一樣,!操做符的行爲與C、Java等語言是一致的,只返回boolean值(true或false)。 針對於!運算,0以及null、""(空字符串)、NaN、undefined,空對象算是作false,加上!將返回true console.log(!0); //null console.log(!null);//null console.log(NaN); //null consol
相關文章
相關標籤/搜索