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
Google Formsで記述式の質問に字数制限を設定したい
記述式の質問には「回答の検証」を設定することができます フォームの編集画面 右下の︙メニューで「回答の検証」を選択します 検証方法には「数値」「テキスト」「長さ」「正規表現」という種類があります 今回は字数制限したいので「長さ」を選びます 長さには「最大文字数」か「最小文字数」を...