From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- files/ko/glossary/truthy/index.html | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 files/ko/glossary/truthy/index.html (limited to 'files/ko/glossary/truthy/index.html') diff --git a/files/ko/glossary/truthy/index.html b/files/ko/glossary/truthy/index.html new file mode 100644 index 0000000000..ae92e41292 --- /dev/null +++ b/files/ko/glossary/truthy/index.html @@ -0,0 +1,53 @@ +--- +title: 참 같은 값 +slug: Glossary/Truthy +tags: + - CodingScripting + - Glossary + - JavaScript +translation_of: Glossary/Truthy +--- +

{{Glossary("JavaScript")}}에서, 참 같은 값(Truthy)인 값이란 {{Glossary("Boolean", "불리언")}}을 기대하는 문맥에서 true로 평가되는 값입니다. 따로 {{Glossary("Falsy", "거짓 같은 값")}}으로 정의된 값이 아니면 모두 참 같은 값으로 평가됩니다. (예: false0-00n""nullundefined와 NaN 등)

+ +

JavaScript는 불리언 문맥에서 {{Glossary("Type_Conversion", "형 변환")}}을 사용합니다.

+ +

다음은 참 같은 값에 대한 예시입니다. JavaScript는 불리언 문맥에서 참 같은 값을 true로 변환하기 때문에 아래의 모든 if 블록을 실행합니다.

+ +
if (true)
+if ({})
+if ([])
+if (42)
+if ("0")
+if ("false")
+if (new Date())
+if (-42)
+if (12n)
+if (3.14)
+if (-3.14)
+if (Infinity)
+if (-Infinity)
+ +

Specifications

+ + + + + + + + + + + + +
Specification
{{SpecName("ESDraft", "#sec-toboolean", "ToBoolean abstract operation")}}
+ +

같이 보기

+ + + +
{{QuickLinksWithSubpages("/ko/docs/Glossary")}}
-- cgit v1.2.3-54-g00ecf