スプレッドシートでの TRUE または FALSE は、GAS 上では小文字の文字列('true' または 'false')扱い

gyazo.com

結論

とあるセルに TRUE あるいは FALSE というデータが格納されているとき、GAS 上での判別は以下のようになります。

// targetCell に TRUE というデータが格納されているとします

console.log(typeof targetCell); // string
console.log(targetCell); // true
console.log(targetCell === true) // false
console.log(targetCell === 'true') // true
console.log(targetCell === 'TRUE') // false
// console.log(targetCell === TRUE) // ERROR
Powered by はてなブログ