From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/glossary/boolean/index.html | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 files/ja/glossary/boolean/index.html (limited to 'files/ja/glossary/boolean/index.html') diff --git a/files/ja/glossary/boolean/index.html b/files/ja/glossary/boolean/index.html new file mode 100644 index 0000000000..d2a8f0d1e3 --- /dev/null +++ b/files/ja/glossary/boolean/index.html @@ -0,0 +1,49 @@ +--- +title: Boolean +slug: Glossary/Boolean +tags: + - Boolean + - Glossary + - JavaScript + - データ型 + - プログラミング言語 +translation_of: Glossary/Boolean +--- +

コンピューター科学において、boolean(論理型、真偽値型)は true(真)か false(偽)の値のみを取れる論理データ型です。たとえば、 JavaScript では boolean による条件がコードの部分を実行するか(if 文の中など)や繰り返し(for ループなど)を決定します。

+ +
/* JavaScript if 文 */
+if (boolean 条件) {
+   // 条件が true の場合に実行するコード
+}
+
+if (boolean 条件) {
+  console.log("boolean 条件が true になった");
+} else {
+  console.log("boolean 条件が false になった");
+}
+
+
+/* JavaScript for ループ */
+for (制御変数; boolean 条件; カウンター) {
+  // 条件が true の場合に繰り返し実行されるコード
+}
+
+for (var i=0; i < 4; i++) {
+  console.log("boolean 条件が true の場合のみ表示");
+}
+
+ +

関連情報

+ +

基礎知識

+ + + +

技術リファレンス

+ + -- cgit v1.2.3-54-g00ecf