I share this blog with my thoughts and creations from my daily programming, knowledge, and technology updates.
Apps Scriptリファレンス: Apps Script Reference
|障害・課題追跡: IssueTracker
|Google Workspace: Status Dashboard
- Summary
2019年1月26日土曜日
JavaScript関数の定義についてメモ
関数の定義にもいくつか種類がある
関数宣言
よく使うfunction 文
function showAlert() {
alert("hello");
}
関数式
無名関数
var myFunction = function() {
alert("hello");
}
名前付き関数
var myFunction = function showAlert(){
alert("hello");
}
即時関数
(function() {
alert("hello");
})();
アロー関数
() => {
alert("hello")
};
これはまだ個人的に使う機会がない
ジェネレータ関数
function* name([param[, param[, ... param]]]) {
statements
}
Latest post
スプレッドシートの空白セルを直前の値で埋めたい
A列の空白セルに直前の値を入れたくて書いたコードです スプレッドシートに以下のようなBeforeの表があるとき (A列に空白セルがある) Before 1 A B 2 エリア 都市 3 東京 新宿 4 渋谷 5 池袋 6 神奈川 横浜 7 川崎 8 相模原 9 千葉 千葉 10 ...