Files
2nd/10_Wiki/Dev/Topic_JavaScript/JavaScript_Primitive_Data.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

6.4 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
javascript-primitive-data-types JavaScript Primitive Data Types Frontend draft conceptual
JS primitives
primitive types
string number boolean
undefined null
BigInt
B 0.89 2026-06-23 2026-06-23
javascript
js
web
frontend
w3schools
primitives
data-types
string
number
https://www.w3schools.com/js/js_datatypes_primitives.asp

JavaScript Primitive Data Types

🎯 한 줄 통찰 (One-line insight)

JavaScript has 7 primitive data types — Number, BigInt, String, Boolean, Undefined, Null, and Symbol — each a simple, immutable value distinct from the single object type. [S1]

🧠 핵심 개념 (Core concepts)

  • 7 primitive types — JavaScript variables can hold 7 primitive types (Number, BigInt, String, Boolean, Undefined, Null, Symbol) or 1 object type. [S1]
  • Strings — a string is a series of characters, written with single or double quotes. [S1]
  • Numbers are 64-bit floats — all JavaScript numbers are stored as double (64-bit floating point) values; they support decimals and exponential notation. [S1]
  • BigInt (ES2020) — handles integers too large for standard numbers. [S1]
  • Undefined vs Null — a variable without a value is undefined; null represents the intentional absence of a value, but typeof null returns "object" (a historical quirk). [S1]

🧩 추출된 패턴 (Extracted patterns)

  • Nest opposite quotes — put single quotes inside double-quoted strings (and vice versa) to avoid escaping. [S1]
  • === vs == for null/undefined — strict equality (===) is true only when value and type match; loose equality (==) treats null and undefined as equal. [S1]
  • Empty string is still a stringlet car = ""; has value "" and typeof "string". [S1]

📖 세부 내용 (Details)

JavaScript variables can hold 8 types of data: 7 primitive types or 1 object type. The primitive types are: Number, BigInt, String, Boolean, Undefined, Null, and Symbol. [S1]

JavaScript Strings A string is a series of characters like "John Doe", written with single or double quotes. [S1]

// Using double quotes:
let carName1 = "Volvo XC60";

// Using single quotes:
let carName2 = 'Volvo XC60';

You can nest the opposite quote type inside a string: [S1]

// Single quote inside double quotes:
let answer1 = "It's alright";

// Single quotes inside double quotes:
let answer2 = "He is called 'Johnny'";

// Double quotes inside single quotes:
let answer3 = 'He is called "Johnny"';

JavaScript Numbers All JavaScript numbers are stored as decimal (floating point) values — always double (64-bit floating point). [S1]

// With decimals:
let x1 = 34.00;

// Without decimals:
let x2 = 34;

Exponential notation: [S1]

let y = 123e5;    // 12300000
let z = 123e-5;   // 0.00123

JavaScript BigInt BigInt (ES2020) handles integers too large for standard numbers: [S1]

let x = BigInt("123456789012345678901234567890");

JavaScript Booleans Booleans can only hold true or false: [S1]

let x = 5;
let y = 5;
let z = 6;
(x == y)       // Returns true
(x == z)       // Returns false

The typeof Operator The typeof operator identifies a variable's type. [S1]

typeof ""             // Returns "string"
typeof "John"         // Returns "string"
typeof "John Doe"     // Returns "string"
typeof 0              // Returns "number"
typeof 314            // Returns "number"
typeof 3.14           // Returns "number"
typeof (3)            // Returns "number"
typeof (3 + 4)        // Returns "number"

Undefined A variable without a value has the value undefined and the type undefined: [S1]

let car;    // Value is undefined, type is undefined
car = undefined;    // Value is undefined, type is undefined

Empty Values An empty string has both a legal value and a type: [S1]

let car = "";    // The value is "", the typeof is "string"

Datatype null null represents "nothing" — the intentional absence of a value: [S1]

let carName = null;

Notes on null: the typeof operator returns "object" for null (a historical quirk); the strict equality operator === returns true only if both value and type match; the loose equality operator == returns true for both null and undefined. [S1]

🛠️ 적용 사례 (Applied in summary)

The page's own declarations (string quoting variants, number/exponent/BigInt literals, boolean comparisons, and the undefined/empty/null examples) are the canonical applied examples. No external project/commit applications found in the source.

💻 코드 패턴 (Code patterns)

Nest opposite quotes (language: JavaScript):

let answer1 = "It's alright";
let answer3 = 'He is called "Johnny"';

Exponential number notation:

let y = 123e5;    // 12300000
let z = 123e-5;   // 0.00123

⚖️ 모순 및 업데이트 (Contradictions & updates)

typeof null returns "object" even though null is a primitive value — the page flags this as a historical quirk. BigInt was introduced in ES2020. [S1]

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.89
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Primitive Data Types" page (Astra wiki-curation, P-Reinforce v3.1 format).