LoginSignup
0
0

More than 5 years have passed since last update.

JavaScript 中 `!!` 的作用

Last updated at Posted at 2018-05-10

簡單來說,
!! 可以判斷跟在他後面式子的真/假 (true/false) ,並回傳判斷的結果。

式子是 falsy value 的話,也會回傳 false
像是 上一篇 有提到的這幾個值

  • undefined, null, NaN, false, 0 , '' / ""

image

參考資料

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0