W3Schools 튜토리얼을 P-Reinforce v3.1 포맷으로 위키화(영어 본문, 한/영 섹션 헤더). - Topic_HTML: 59문서 (튜토리얼+예제, 레퍼런스/메타 제외) - Topic_CSS: 190문서 (메인 + Advanced/Flexbox/Grid/RWD 전체) - Topic_JavaScript: 120문서 (코어 언어; Temporal/DOM상세/BOM/WebAPI/AJAX/jQuery/Graphics 등은 후속) 각 폴더 00_INDEX.md(MOC) 포함. 코드 verbatim, 미확인분은 "Not found in source" 표기. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6.5 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-operators | JavaScript Operators | Frontend | draft | conceptual |
|
B | 0.88 | 2026-06-23 | 2026-06-23 |
|
|
JavaScript Operators
🎯 한 줄 통찰 (One-line insight)
JavaScript operators are used for mathematical and logical computations — the = assigns, + adds (and concatenates strings), * multiplies, and comparison/logical operators evaluate conditions. [S1]
🧠 핵심 개념 (Core concepts)
- Operators are for mathematical and logical computations — they perform operations on values and variables. [S1]
- Four core single examples — the assignment operator
=assigns values, the addition operator+adds, the multiplication operator*multiplies, and the comparison operator>compares. [S1] - Operator categories — JavaScript operators include Arithmetic, Assignment, Comparison, Logical, and String operators. [S1]
+is overloaded — when used on strings, the+operator is called the concatenation operator; if you add a number and a string, the result is a string. [S1]- Comparisons return booleans — comparison operators always return
trueorfalse, and strings are compared alphabetically. [S1]
🧩 추출된 패턴 (Extracted patterns)
- Compute into a new variable — combine two operands with an arithmetic operator and store the result:
let z = x + y;. [S1] - Compound assignment —
x += 5is shorthand forx = x + 5. [S1] - Concatenate then assign — build a string with
+and a separator:text1 + " " + text2. [S1]
📖 세부 내용 (Details)
Operators are for Mathematical and Logical Computations [S1]
The assignment operator (=) assigns a value to a variable:
let x = 10;
The addition operator (+) adds values:
let x = 5;
let y = 2;
let z = x + y;
The multiplication operator (*) multiplies values:
let x = 5;
let y = 2;
let z = x * y;
A more complex expression mixing addition and multiplication: [S1]
let a = 3;
let x = (100 + 50) * a;
Types of JavaScript Operators [S1] There are different types of JavaScript operators: Arithmetic, Assignment, Comparison, String, Logical, and others.
JavaScript Arithmetic Operators [S1] Arithmetic operators are used to perform arithmetic on numbers:
| Operator | Description |
|---|---|
| + | Addition |
| - | Subtraction |
| * | Multiplication |
| ** | Exponentiation |
| / | Division |
| % | Modulus (Division Remainder) |
| ++ | Increment |
| -- | Decrement |
JavaScript String Addition [S1]
When used on strings, the + operator is called the concatenation operator:
let text1 = "John";
let text2 = "Doe";
let text3 = text1 + " " + text2;
The += assignment operator can also concatenate:
let text1 = "What a very ";
text1 += "nice day";
Adding Strings and Numbers [S1] If you add a number and a string, the result will be a string:
let x = 5 + 5;
let y = "5" + 5;
let z = "Hello" + 5;
JavaScript Assignment Operators [S1]
Assignment operators assign values to JavaScript variables. For example, x += 5 is the same as x = x + 5:
let x = 10;
x += 5;
| Operator | Example | Same As |
|---|---|---|
| = | x = y | x = y |
| += | x += y | x = x + y |
| -= | x -= y | x = x - y |
| *= | x *= y | x = x * y |
| /= | x /= y | x = x / y |
| %= | x %= y | x = x % y |
| **= | x **= y | x = x ** y |
JavaScript Comparison Operators [S1]
Comparison operators always return true or false:
let x = 5;
let result = x > 8;
| Operator | Description | Example |
|---|---|---|
| == | equal to | x == 5 |
| === | equal value and equal type | x === 5 |
| != | not equal | x != 5 |
| !== | not equal value or not equal type | x !== 5 |
| > | greater than | x > 5 |
| < | less than | x < 5 |
| >= | greater than or equal to | x >= 5 |
| <= | less than or equal to | x <= 5 |
Strings are compared alphabetically: [S1]
let text1 = "A";
let text2 = "B";
let result = text1 < text2;
JavaScript Logical Operators [S1]
| Operator | Description |
|---|---|
| && | logical and |
| || | logical or |
| ! | logical not |
🛠️ 적용 사례 (Applied in summary)
The page's own snippets are the canonical applied examples — assigning with =, computing with +/*, concatenating strings, compound-assigning with +=, and comparing values/strings. No external project/commit applications found in the source.
💻 코드 패턴 (Code patterns)
Compute and store a result:
let x = 5;
let y = 2;
let z = x + y;
Concatenate strings with a separator:
let text3 = text1 + " " + text2;
Compound assignment:
let x = 10;
x += 5;
⚖️ 모순 및 업데이트 (Contradictions & updates)
No contradictions found in the source. The behavior that "5" + 5 yields a string ("55") rather than 10 is intentional, not a contradiction — + concatenates when a string operand is present.
✅ 검증 상태 및 신뢰도
- 상태: draft
- 검증 단계: conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
- 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
- 신뢰 점수: 0.88
- 중복 검사 결과: 신규 생성 (New discovery)
🔗 지식 그래프 (Knowledge Graph)
- 상위/루트: JavaScript Tutorial
- 관련 개념: JavaScript Arithmetic, JavaScript Assignment, JavaScript Comparisons, JavaScript Types
- 참조 맥락: The umbrella reference for the operator-family pages (arithmetic, assignment, comparison, logical) that follow it.
📚 출처 (Sources)
- [S1] W3Schools — JavaScript Operators — https://www.w3schools.com/js/js_operators.asp
📝 변경 이력 (Change history)
- 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Operators" page (Astra wiki-curation, P-Reinforce v3.1 format).