簡單說 0 == “string" 會恆為 true 的原因就是:


因為字串轉換成 integer 會變成 0 (使用 strtod() 來作 ATOI 的時候, 無法轉換 就會變成 0), 所以用 === 解決 或是 將0改為字串"0"