From 6ca84f1794af830ada9736d7289ce29aabb04ca3 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:05 +0800 Subject: remove `notranslate` class in zh-TW --- .../reference/operators/conditional_operator/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'files/zh-tw/web/javascript/reference/operators/conditional_operator') diff --git a/files/zh-tw/web/javascript/reference/operators/conditional_operator/index.html b/files/zh-tw/web/javascript/reference/operators/conditional_operator/index.html index cd0ccfa160..cd7f851374 100644 --- a/files/zh-tw/web/javascript/reference/operators/conditional_operator/index.html +++ b/files/zh-tw/web/javascript/reference/operators/conditional_operator/index.html @@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Operators/Conditional_Operator

語法

-
condition ? exprIfTrue : exprIfFalse
+
condition ? exprIfTrue : exprIfFalse

參數

@@ -32,14 +32,14 @@ translation_of: Web/JavaScript/Reference/Operators/Conditional_Operator

一個簡單的範例:

-
var age = 26;
+
var age = 26;
 var beverage = (age >= 21) ? "Beer" : "Juice";
 console.log(beverage); // "Beer"
 

一個常用來處理 null 的用法 : 

-
function greeting(person) {
+
function greeting(person) {
     var name = person ? person.name : "stranger";
     return "Howdy, " + name;
 }
@@ -52,7 +52,7 @@ console.log(greeting(null));             // "Howdy, stranger"
 
 

條件 (三元) 運算子是右相依性的 (right-associative), 代表他可以以下面的方式鏈結 , 類似於 if … else if … else if … else 的鏈結方法 :

-
function example(…) {
+
function example(…) {
     return condition1 ? value1
          : condition2 ? value2
          : condition3 ? value3
-- 
cgit v1.2.3-54-g00ecf