[GAS][slack]営業日カウントダウンbotを作っている途中 その7
前回
https://note.com/0375/n/n4a5587d3ae22
いま気になっていること
emoji-codeでもアイコンいけるんじゃないの?
webhoook
SlackAPI ライブラリ ちゃんと理解したい
カレンダ 祝日+土日+指定休日の統合?
スクリプトファイルの並び順 https://developers.google.com/apps-script/releases
会社指定休日をクラスに持たせる?
営業日判定もクラスに持たせる?
スプレッドシートいらなくなる?
postSlackbotの関数もSlackに関するクラス を作る(かetauさんのを使うか)してロジック整理する
マジックナンバーの整理
不等価 (!=)と厳密不等価 (!==)
あと細かいところ
不等価 (!=)と厳密不等価 (!==)
function test() {
console.log(3 != "3");// false
console.log(3 !== "3");// true
console.log(typeof 3);// number
console.log(typeof "3");// string
}
3 != "3"
オペランド(この場合は、3)のみ見ている。データ型は見ていない。
3 !== "3"
左辺はnumber型であるのに対し、右辺はstringなので、型が一致していないことも考慮している。
if (calJpHoliday.getEventsForDay(targetDate).length != 0)
!==でなく != を使っているけど理由がなければ !== に。
if (winterHolidays.includes(targetDate.getTime()) == true)
同様に=== ではなく==も理由がなければ===にする。
マジックナンバーの整理

こんな感じにするかどうか。

こうするためには、これをこうしてこうじゃ。



いいなと思ったら応援しよう!
