diff --git a/1-js/02-first-steps/13-while-for/article.md b/1-js/02-first-steps/13-while-for/article.md index 5e8991c27c..fee9f4adcc 100644 --- a/1-js/02-first-steps/13-while-for/article.md +++ b/1-js/02-first-steps/13-while-for/article.md @@ -47,8 +47,8 @@ while (i) { // i가 0이 되면 조건이 falsy가 되므로 반복문이 멈춥 } ``` -````smart header="본문이 한 줄이면 대괄호를 쓰지 않아도 됩니다." -반복문 본문이 한 줄짜리 문이라면 대괄호 `{…}`를 생략할 수 있습니다. +````smart header="본문이 한 줄이면 중괄호를 쓰지 않아도 됩니다." +반복문 본문이 한 줄짜리 문이라면 중괄호 `{…}`를 생략할 수 있습니다. ```js run let i = 3; @@ -268,7 +268,7 @@ for (let i = 0; i < 10; i++) { 기술적인 관점에서 봤을 때, 이 예시는 위쪽에 있는 예시와 동일합니다. `continue`를 사용하는 대신 코드를 `if` 블록으로 감싼 점만 다릅니다. -그런데 이렇게 코드를 작성하면 부작용으로 중첩 레벨(대괄호 안의 `alert` 호출)이 하나 더 늘어납니다. `if` 안의 코드가 길어진다면 전체 가독성이 떨어질 수 있습니다. +그런데 이렇게 코드를 작성하면 부작용으로 중첩 레벨(중괄호 안의 `alert` 호출)이 하나 더 늘어납니다. `if` 안의 코드가 길어진다면 전체 가독성이 떨어질 수 있습니다. ```` ````warn header="'?' 오른쪽엔 `break`나 `continue`가 올 수 없습니다." diff --git a/1-js/02-first-steps/16-function-expressions/article.md b/1-js/02-first-steps/16-function-expressions/article.md index daac603d43..1ea5b81e3a 100644 --- a/1-js/02-first-steps/16-function-expressions/article.md +++ b/1-js/02-first-steps/16-function-expressions/article.md @@ -365,4 +365,4 @@ welcome(); // 제대로 동작합니다. 함수를 선언해야 한다면 함수가 선언되기 이전에도 함수를 활용할 수 있기 때문에, 함수 선언문 방식을 따르는 게 좋습니다. 함수 선언 방식은 코드를 유연하게 구성할 수 있도록 해주고, 가독성도 좋습니다. -함수 표현식은 함수 선언문을 사용하는게 부적절할 때에 사용하는 것이 좋습니다. 이번 챕터에서 함수 선언문을 사용해야만 하는 경우를 몇 가지 알아보았는데, 튜토리얼 뒤쪽에서 좀 더 깊게 해당 사례를 살펴보도록 하겠습니다. +함수 표현식은 함수 선언문을 사용하는게 부적절할 때에 사용하는 것이 좋습니다. 이번 챕터에서 함수 표현식을 사용해야만 하는 경우를 몇 가지 알아보았는데, 튜토리얼 뒤쪽에서 좀 더 깊게 해당 사례를 살펴보도록 하겠습니다. diff --git a/1-js/02-first-steps/18-javascript-specials/article.md b/1-js/02-first-steps/18-javascript-specials/article.md index 277b9f20c8..915fdf1513 100644 --- a/1-js/02-first-steps/18-javascript-specials/article.md +++ b/1-js/02-first-steps/18-javascript-specials/article.md @@ -259,7 +259,7 @@ switch (age) { // 화살표(=>) 우측엔 표현식이 있음 let sum = (a, b) => a + b; - // 대괄호{ ... }를 사용하면 본문에 여러 줄의 코드를 작성할 수 있음. return문이 꼭 있어야 함. + // 중괄호{ ... }를 사용하면 본문에 여러 줄의 코드를 작성할 수 있음. return문이 꼭 있어야 함. let sum = (a, b) => { // ... return a + b; diff --git a/1-js/05-data-types/01-primitives-methods/article.md b/1-js/05-data-types/01-primitives-methods/article.md index 95801e0ea7..a07937a393 100644 --- a/1-js/05-data-types/01-primitives-methods/article.md +++ b/1-js/05-data-types/01-primitives-methods/article.md @@ -12,7 +12,7 @@ 객체: - 프로퍼티에 다양한 종류의 값을 저장할 수 있습니다. -- `{name : "John", age : 30}`와 같이 대괄호 `{}`를 사용해 만들 수 있습니다. 자바스크립트에는 여러 종류의 객체가 있는데, 함수도 객체의 일종입니다. +- `{name : "John", age : 30}`와 같이 중괄호 `{}`를 사용해 만들 수 있습니다. 자바스크립트에는 여러 종류의 객체가 있는데, 함수도 객체의 일종입니다. 객체의 장점 중 하나는 함수를 프로퍼티로 저장할 수 있다는 것입니다. diff --git a/1-js/05-data-types/02-number/4-endless-loop-error/solution.md b/1-js/05-data-types/02-number/4-endless-loop-error/solution.md index 8bc55bd027..c7bb53cbb9 100644 --- a/1-js/05-data-types/02-number/4-endless-loop-error/solution.md +++ b/1-js/05-data-types/02-number/4-endless-loop-error/solution.md @@ -1,6 +1,6 @@ -That's because `i` would never equal `10`. +`i`는 절대 `10`이 될 수 없어서 무한 루프가 발생합니다. -Run it to see the *real* values of `i`: +코드를 실행해 실제 `i` 값을 확인해 봅시다. ```js run let i = 0; @@ -10,8 +10,8 @@ while (i < 11) { } ``` -None of them is exactly `10`. +어떤 경우에도 `i`는 `10`이 될 수 없습니다. -Such things happen because of the precision losses when adding fractions like `0.2`. +이런 일이 발생하는 이유는 `0.2`와 같은 분수를 더할 때 정밀도 손실이 발생하기 때문입니다. -Conclusion: evade equality checks when working with decimal fractions. \ No newline at end of file +그러므로 소수나 분수를 대상으로 작업 할 땐 등호 비교를 피하세요. diff --git a/1-js/05-data-types/02-number/4-endless-loop-error/task.md b/1-js/05-data-types/02-number/4-endless-loop-error/task.md index 592ece31c0..a5f63e929f 100644 --- a/1-js/05-data-types/02-number/4-endless-loop-error/task.md +++ b/1-js/05-data-types/02-number/4-endless-loop-error/task.md @@ -2,9 +2,9 @@ importance: 4 --- -# An occasional infinite loop +# 무한 루프 -This loop is infinite. It never ends. Why? +아래 반복문은 무한대로 작동합니다. 왜 그럴까요? ```js let i = 0; diff --git a/1-js/05-data-types/02-number/8-random-min-max/solution.md b/1-js/05-data-types/02-number/8-random-min-max/solution.md index 8736c3d561..edbd7752da 100644 --- a/1-js/05-data-types/02-number/8-random-min-max/solution.md +++ b/1-js/05-data-types/02-number/8-random-min-max/solution.md @@ -1,8 +1,8 @@ We need to "map" all values from the interval 0..1 into values from `min` to `max`. -That can be done in two stages: +이 작업은 두 단계로 이루어집니다. -1. If we multiply a random number from 0..1 by `max-min`, then the interval of possible values increases `0..1` to `0..max-min`. +1. 0과 1 사이의 임의의 숫자에 `max-min`를 곱하면 가능한 값의 간격이 `0..1`에서 `0..max-min`으로 증가합니다. 2. Now if we add `min`, the possible interval becomes from `min` to `max`. The function: diff --git a/1-js/05-data-types/02-number/8-random-min-max/task.md b/1-js/05-data-types/02-number/8-random-min-max/task.md index 7037cfcbb9..841da4111c 100644 --- a/1-js/05-data-types/02-number/8-random-min-max/task.md +++ b/1-js/05-data-types/02-number/8-random-min-max/task.md @@ -2,13 +2,13 @@ importance: 2 --- -# A random number from min to max +# min과 max 사이에 있는 임의의 숫자 생성하기 -The built-in function `Math.random()` creates a random value from `0` to `1` (not including `1`). +내장 함수 `Math.random()`은 `0`부터 `1`까지의(`1`은 포함되지 않음) 랜덤한 값을 생성합니다. -Write the function `random(min, max)` to generate a random floating-point number from `min` to `max` (not including `max`). +`random(min, max)`함수를 작성하여 `min`부터 `max`까지 임의의 부동 소수점 숫자를 생성합니다(`max`는 포함되지 않음). -Examples of its work: +예시를 살펴봅시다. ```js alert( random(1, 5) ); // 1.2345623452 diff --git a/1-js/05-data-types/02-number/article.md b/1-js/05-data-types/02-number/article.md index dfaf6d483f..3b04f080a0 100644 --- a/1-js/05-data-types/02-number/article.md +++ b/1-js/05-data-types/02-number/article.md @@ -29,8 +29,8 @@ alert( 7.3e9 ); // 73억 (7,300,000,000) 즉, `'e'`는 e 왼쪽의 수에 e 오른쪽에 있는 수만큼의 10의 거듭제곱을 곱하는 효과가 있습니다. ```js -1e3 = 1 * 1000 -1.23e6 = 1.23 * 1000000 +1e3 === 1 * 1000 +1.23e6 === 1.23 * 1000000 ``` 이제 아주 작은 숫자인 1마이크로초(백만 분의 1초)를 표현해보겠습니다. @@ -51,10 +51,10 @@ let ms = 1e-6; // 1에서 왼쪽으로 6번 소수점 이동 ```js // 10을 세 번 거듭제곱한 수로 나눔 -1e-3 = 1 / 1000 (=0.001) +1e-3 === 1 / 1000 // 0.001 // 10을 여섯 번 거듭제곱한 수로 나눔 -1.23e-6 = 1.23 / 1000000 (=0.00000123) +1.23e-6 === 1.23 / 1000000 // 0.00000123 ``` ### 16진수, 2진수, 8진수 diff --git a/1-js/05-data-types/10-destructuring-assignment/article.md b/1-js/05-data-types/10-destructuring-assignment/article.md index e8076ec788..42842f08a1 100644 --- a/1-js/05-data-types/10-destructuring-assignment/article.md +++ b/1-js/05-data-types/10-destructuring-assignment/article.md @@ -7,6 +7,7 @@ 개발을 하다 보면 함수에 객체나 배열을 전달해야 하는 경우가 생기곤 합니다. 가끔은 객체나 배열에 저장된 데이터 전체가 아닌 일부만 필요한 경우가 생기기도 하죠. 이럴 때 객체나 배열을 변수로 '분해'할 수 있게 해주는 특별한 문법인 *구조 분해 할당(destructuring assignment)* 을 사용할 수 있습니다. 이 외에도 함수의 매개변수가 많거나 매개변수 기본값이 필요한 경우 등에서 구조 분해(destructuring)는 그 진가를 발휘합니다. +*Destructuring assignment* is a special syntax that allows us to "unpack" arrays or objects into a bunch of variables, as sometimes that's more convenient. ## 배열 분해하기 @@ -69,7 +70,6 @@ alert( title ); // Consul let [a, b, c] = "abc"; // ["a", "b", "c"] let [one, two, three] = new Set([1, 2, 3]); ``` - ```` diff --git a/1-js/05-data-types/12-json/article.md b/1-js/05-data-types/12-json/article.md index 129de10388..35a0c0ee94 100644 --- a/1-js/05-data-types/12-json/article.md +++ b/1-js/05-data-types/12-json/article.md @@ -178,7 +178,7 @@ JSON.stringify(meetup); // Error: Converting circular structure to JSON `JSON.stringify`의 전체 문법은 아래와 같습니다. ```js -let json = JSON.stringify(value[, replacer, space]) +let json = JSON.stringify(value, [replacer, space]) ``` value diff --git a/1-js/06-advanced-functions/01-recursion/article.md b/1-js/06-advanced-functions/01-recursion/article.md index b4961d0689..9cb2855435 100644 --- a/1-js/06-advanced-functions/01-recursion/article.md +++ b/1-js/06-advanced-functions/01-recursion/article.md @@ -234,7 +234,7 @@ function pow(x, n) { 이젠 호출해야 할 중첩 호출이 없습니다. 따라서 함수는 종료되고 `2`가 반환됩니다. -함수가 종료되었기 때문에 이에 상응하는 실행 컨텍스트는 쓸모가 없어졌습니다. 따라서 해당 실행 컨텍스트는 메모리에서 삭제됩니다. 스택 맨 위엔 이전의 실행 컨텍스가 위치하게 됩니다. +함수가 종료되었기 때문에 이에 상응하는 실행 컨텍스트는 쓸모가 없어졌습니다. 따라서 해당 실행 컨텍스트는 메모리에서 삭제됩니다. 스택 맨 위엔 이전의 실행 컨텍스트가 위치하게 됩니다.