Blogger의 논리 연산자는 불리언 값을 비교하는 연산자입니다. 결과는 불리언 값을 반환합니다.
구문
| 이름 | 연산자 | 피연산자 | 기본 구문 | 응용 구문 | 결과 |
|---|---|---|---|---|---|
| 그리고 | && |
제한 없음 |
boolean &&
boolean
|
&&(boolean,boolean)
|
boolean
|
and |
boolean and
boolean
|
and(boolean,boolean)
|
|||
| 또는 | || |
boolean ||
boolean
|
||(boolean,boolean)
|
||
or |
boolean or
boolean
|
or(boolean,boolean)
|
|||
| ~가 아닌 | ! |
1 |
!boolean
|
||
not |
not boolean
|
||||
- 연산 결과는 항상 불리언 값입니다.
-
피연산자는
boolean유형이어야하며 그- 값
- 데이터
- Blogger 표현식 (중첩 연산)의 결과
-
boolean유형의 값을 허용하는 다른 연산에 중첩될 수 있습니다.
참고 : 부울이 아닌 데이터는 비어있는 경우
false로 간주되고 내용이 포함된 경우
true로 간주됩니다.
and 연산자
and 연산자는 모든 피연산자가
true이면 true 값을
반환합니다. 피연산자 중 하나가 false 값을
반환하면 결과는 false이 됩니다.
| 구문 | 결과 |
|---|---|
true and
true
|
true |
false and
false
|
false |
not false and not
false
|
true |
true and
false
|
false |
false and
true
|
false |
true and
true and
true
|
true |
true and
false and
true
|
false |
false and
false and
false
|
false |
or 연산자
or 연산자는 피연산자 중 하나가
true이면 true 값을
반환합니다. 모든 피연산자가 false를 반환하면
결과는 false가됩니다.
| 기본형 | 결과 |
|---|---|
true or
true
|
true |
false or
false
|
false |
not false or not
false
|
true |
true or
false
|
true |
false or
true
|
true |
true or
true or
true
|
true |
true or
false or
true
|
true |
false or
false or
false
|
false |
not 연산자
not 연산자는 피연산자의 값을 반대로 합니다.
true는 false가
되고 그 반대의 경우도 마찬가지입니다.
| 기본형 | 결과 |
|---|---|
not true
|
false |
not false
|
true |
not 연산자는 member 연산자 및
contains 연산자와 함께 사용할 수도 있습니다.
not in
not contains
몇 가지 예
and 연산자
<b:if cond='data:view.isHomepage and data:blog.isPrivate'/>
</b:if>
or 연산자
<b:if cond='data:view.isHomepage or data:blog.isPrivate'/>
</b:if>
not 연산자
<b:if cond='not data:view.isHomepage'/>
</b:if>
람다 연산 중첩
<b:if cond='data:posts count (p => p.labels.any and p.title)'/>
</b:if>
''
삼항 연산 중첩
<b:if cond='data:blog.locale.language == "ko" and data:blog.locale.country == "jp" ? "블로그 언어가 한국어이거나 일본어입니다." : "기타 언어입니다."'/>
</b:if>
응용 구문
응용 구문은 기본 구문에 동일한 논리 연산자가 여러 번 포함될 때 사용할 수 있는 대안입니다.
== (allType,allType)
!= (allType,allType)
gt (number,number)
gte (number,number)
lt (number,number)
lte (number,number)
다른 연산자
-
+ (concatenate) -
+ (addition) -
- (substraction) -
* (multiplication) -
/ (division) -
% (modulus) -
?: (selector) -
all -
and (&&) -
any -
appendParams -
contains (array) -
contains (string) -
count -
eq (==) -
filter -
first -
format -
fragment -
gt (>) -
gte (>=) -
in -
limit -
lt (<) -
lte (<=) -
map -
neq (!=) -
none -
not (!) -
offset -
or (||) -
params -
path -
resizeImage -
select -
Skip -
snippet -
sourceSet -
take -
to -
where