# 操作者 concept_wd5_pj5_dgb

``````    // left-hand unary operators
<operator> <operand> // operand is an expression

// right-hand unary operators
<operand> <operator> // operand is an expression
@{LobbyBeacon.endUserIDs._experience.emailid.id} is not null

// binary operators
<operand1> <operator> <operand2>
``````

## 重要備註 important-notes

• 使用乘法(`*`)時，兩個作業欄位必須具有相同的型別，可以是整數或小數。 範例：

• 下列範例是正確的： `3.0 * 4.0`
• `3 * 4.0`將導致錯誤

## 邏輯 logical

### 和

``````<expression1> and <expression2>
``````

<expression1>和<expression2>都必須是布林值。 結果是布林值。

``````3.14 > 2 and 3.15 < 1
``````

### 或

``````<expression1> or <expression2>
``````

<expression1>和<expression2>都必須是布林值。 結果是布林值。

``````3.14 > 2 or 3.15 < 1
``````

### 非

``````not <expression>
``````

<expression>必須為布林值。 結果是布林值。

``````not 3.15 < 1
``````

## 比較 comparison

### 為null

``````<expression> is null
``````

``````@{BarBeacon.location} is null
``````

### 不是null

``````<expression> is not null
``````

``````@ is not null
``````

### 具有null

``````<expression> has null
``````

<expression>必須是清單。 結果是布林值。

``````["foo", "bar", null] has null --  returns true.
``````
``````["foo", "bar", ""] has null -- returns false because "" is not considered as null.
``````

### ==

``````<expression1> == <expression2>
``````

<expression1>和<expression2>必須有相同的資料型別。 結果是布林值。

``````3.14 == 42
``````
``````"foo" == "bar"
``````

### ！=

``````<expression1> != <expression2>
``````

<expression1>和<expression2>必須有相同的資料型別。 結果是布林值。

``````3.14 != 42
``````
``````"foo" != "bar"
``````

### >

``````<expression1> > <expression2>
``````

Datetimeonly可以與Datetimeonly比較。

``````3.14 > 42
``````

### >=

``````<expression1> >= <expression2>
``````

Datetimeonly可以與Datetimeonly比較。

``````42 >= 3.14
``````

### <

``````<expression1> < <expression2>
``````

Datetimeonly可以與Datetimeonly比較。

``````42 < 3.14
``````

### <=

``````<expression1> <= <expression2>
``````

Datetimeonly可以與Datetimeonly比較。

``````42 <= 3.14
``````

## 算術 arithmetic

### +

``````<expression1> + <expression2>
``````

``````1 + 2 -- returns 3
``````

### -

``````<expression1> - <expression2>
``````

``````2 - 1 -- returns 1
``````

### /

``````<expression1> / <expression2>
``````

<expression2>不可以等於0 （傳回0）。

``````4 / 2 -- returns 2
``````

### *

``````<expression1> * <expression2>
``````

``````3 * 4 -- returns 12
``````

### %

``````<expression1> % <expression2>
``````

``````3 % 2 -- returns 1.
``````

## Math math

### 是數值

``````<expression> is numeric
``````

``````@ is numeric
``````

### 為整數

``````<expression> is integer
``````

``````@ is integer
``````

### 為小數

``````<expression> is decimal
``````

``````@ is decimal
``````

## 字串 string

### +

``````<string> + <expression>
``````
``````<expression> + <string>
``````

``````"the current time is " + (now()) -- returns "the current time is 2019-09-23T09:30:06.693Z"
``````
``````(now()) + " is the current time" -- returns "2019-09-23T09:30:06.693Z is the current time"
``````
``````"a" + "b" + "c" + 1234 -- returns "abc1234".
``````

## 日期 date

### +

``````<expression> + <duration>
``````

``````toDateTime("2011-12-03T15:15:30Z") + toDuration("PT15M") -- returns 2011-12-03T15:30:30Z
``````
``````toDateTimeOnly("2011-12-03T15:15:30") + toDuration("PT15M") -- returns 2011-12-03T15:30:30
``````
``````now() + toDuration("PT1H") -- returns a dateTime (with UTC time zone) one hour later from current time
``````
``````toDuration("PT1H") + toDuration("PT1H") -- returns  PT2H
``````
recommendation-more-help
4f4a00c1-77c9-4eee-84df-bbe6206c3ab9