Skip to content

#16 Advanced Functions 번역 01 - 05 #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ed93f3f
Recursion And Stack Translation
singularity-code Mar 28, 2019
a20af19
Recursion And Stack Translation Typo
singularity-code Apr 1, 2019
6b659f1
Rest Parameters & Spread Operator
singularity-code Apr 1, 2019
550c056
Closure Draft
Apr 1, 2019
5251354
Closure Draft
singularity-code Apr 1, 2019
d47170c
Var Draft
singularity-code Apr 1, 2019
1809cc1
Global Object Draft
singularity-code Apr 1, 2019
abd8877
Global Object Draft Fix
singularity-code Apr 1, 2019
d03b89b
Fix Recursion
singularity-code Apr 1, 2019
e00080b
#16 Typo
singularity-code Apr 2, 2019
c01f5d7
#16 Typo Closure
singularity-code Apr 4, 2019
c955709
#16 Recursion Tasks
singularity-code Apr 7, 2019
09fa774
#16 Closure Tasks
singularity-code Apr 7, 2019
558e713
#16 Old var
singularity-code Apr 7, 2019
5d4be69
#16 Function-Object and New Function
singularity-code Apr 7, 2019
cc3e557
#16 Typo 매개변수
singularity-code Apr 8, 2019
cf91c94
#16 Typo
singularity-code Apr 9, 2019
9a023a6
#16 Grammar - Recursion
singularity-code Apr 9, 2019
e10a291
#16 Grammar - Removing "We"
singularity-code Apr 9, 2019
2fad1a8
#16 Review - Recursion
singularity-code Apr 9, 2019
87a581d
#16 Review - Rest Parameters
singularity-code Apr 10, 2019
382bf28
#16 Review - Old Var
singularity-code Apr 10, 2019
382b48e
#16 Review - Global Obj
singularity-code Apr 10, 2019
e3183b0
#16 Review - Closure
singularity-code Apr 10, 2019
98a095c
#16 Review - Closure Tasks
singularity-code Apr 10, 2019
414c2cc
#16 직역수정
singularity-code Apr 11, 2019
c7ddd87
#16 직역수정
singularity-code Apr 11, 2019
1ef93dc
#16 Undo 6 & 7
singularity-code Apr 14, 2019
9e198fb
#16 Recusion 직역수정
singularity-code Apr 14, 2019
a890448
#16 Recursion Tasks 직역수정
singularity-code Apr 14, 2019
26dc200
#16 Recursion 직역수정
singularity-code Apr 15, 2019
a1ed9f3
#16 Rest Parameter 직역수정
singularity-code Apr 16, 2019
38f2ce1
Merge branch 'master' into master
Violet-Bora-Lee Apr 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/04-variables/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## 변수(variable)

[변수(variable)](https://en.wikipedia.org/wiki/Variable_(computer_science)) 는 데이터를 위한 "이름을 붙인 저장소" 입니다. 우리는 상품, 방문객 등의 데이터를 저장하기 위해 변수를 사용할 수 있습니다.
[변수(variable)](https://en.wikipedia.org/wiki/Variable_(computer_science)) 는 데이터를 위한 "이름을 붙인 저장소" 입니다. 상품, 방문객 등의 데이터를 저장하기 위해 변수를 사용할 수 있습니다.

자바스크립트에선 변수를 생성할 때 `let` 키워드를 사용합니다.

Expand Down
4 changes: 2 additions & 2 deletions 1-js/04-object-basics/02-garbage-collection/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

예를 들어:

- 현재 함수의 지역 변수와 매개 변수
- 중첩된 함수 호출로 실행된 경우 현재 스코프 체인에 있는 변수와 매개 변수
- 현재 함수의 지역 변수와 매개변수
- 중첩된 함수 호출로 실행된 경우 현재 스코프 체인에 있는 변수와 매개변수
- 전역 변수
- (내부적인 다른 값들도 존재합니다.)

Expand Down
4 changes: 2 additions & 2 deletions 1-js/04-object-basics/04-object-methods/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ user.sayHi = function() {
user.sayHi(); // Hello!
```

여기서 우리는 함수를 만들기 위해서 Function 표현을 사용했습니다. 그리고 객체의 `user.sayHi` 속성에 이것을 할당해 줬습니다.
여기서 함수를 만들기 위해서 Function 표현을 사용했습니다. 그리고 객체의 `user.sayHi` 속성에 이것을 할당해 줬습니다.

그리고서 이것을 호출할 수 있죠. 이제는 user가 말할 수 있습니다!

객체의 속성인 함수를 *메서드*라고 부릅니다.

즉, 여기서 우리는 `user`안에 `sayHi`메서드를 가진 것이죠.
즉, 여기서 `user`안에 `sayHi`메서드를 가진 것이죠.

물론, 미리 선언된 함수를 메서드로 사용할 수 있습니다. 이렇게요:

Expand Down
20 changes: 10 additions & 10 deletions 1-js/06-advanced-functions/01-recursion/01-sum-to/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ importance: 5

---

# Sum all numbers till the given one
# 주어진 숫자까지 모든 숫자를 합해보세요.

Write a function `sumTo(n)` that calculates the sum of numbers `1 + 2 + ... + n`.
숫자`1 + 2 + ... + n`의 합을 계산하는 함수`sumTo (n)`을 작성하세요.

For instance:
예를들면

```js no-beautify
sumTo(1) = 1
Expand All @@ -17,20 +17,20 @@ sumTo(4) = 4 + 3 + 2 + 1 = 10
sumTo(100) = 100 + 99 + ... + 2 + 1 = 5050
```

Make 3 solution variants:
3 가지 솔루션 변형 만들기

1. Using a for loop.
2. Using a recursion, cause `sumTo(n) = n + sumTo(n-1)` for `n > 1`.
3. Using the [arithmetic progression](https://en.wikipedia.org/wiki/Arithmetic_progression) formula.
1. for 반복문 사용.
2. 재귀를 사용하면`n> 1`에 대해`sumTo (n) = n + sumTo (n-1)`이 됩니다.
3. [산술 진행](https://en.wikipedia.org/wiki/Arithmetic_progression) 공식사용.

An example of the result:
결과의 예

```js
function sumTo(n) { /*... your code ... */ }

alert( sumTo(100) ); // 5050
```

P.S. Which solution variant is the fastest? The slowest? Why?
P.S. 어떤 솔루션 변형이 가장 빠릅니까? 가장 느린 것은 어떤 것 입니까? 왜 그럴까요?

P.P.S. Can we use recursion to count `sumTo(100000)`?
P.P.S. 재귀를 사용하여 `sumTo (100000)`를 계산할 수 있습니까?
13 changes: 6 additions & 7 deletions 1-js/06-advanced-functions/01-recursion/02-factorial/task.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
importance: 4

---
# 계승 계산

# Calculate factorial
자연수의 [계승](https://en.wikipedia.org/wiki/Factorial) (factorialial)은 숫자에 "1"을 곱한 다음 숫자를 2 "등으로 곱한 다음 1까지 계속됩니다. 'n'의 계승은`n! '으로 표시됩니다.

The [factorial](https://en.wikipedia.org/wiki/Factorial) of a natural number is a number multiplied by `"number minus one"`, then by `"number minus two"`, and so on till `1`. The factorial of `n` is denoted as `n!`

We can write a definition of factorial like this:
계승의 정의는 다음과 같이 쓸 수 있습니다

```js
n! = n * (n - 1) * (n - 2) * ...*1
```

Values of factorials for different `n`:
'n'에 대한 계승의 다른 값

```js
1! = 1
Expand All @@ -22,10 +21,10 @@ Values of factorials for different `n`:
5! = 5 * 4 * 3 * 2 * 1 = 120
```

The task is to write a function `factorial(n)` that calculates `n!` using recursive calls.
재귀인 방법을 사용하여`n! '을 계산하는`factorial (n)`함수를 작성하세요.

```js
alert( factorial(5) ); // 120
```

P.S. Hint: `n!` can be written as `n * (n-1)!` For instance: `3! = 3*2! = 3*2*1! = 6`
P.S. 힌트 :`n!``n * (n-1)! '로 쓸 수 있습니다! 예를 들면`3! = 3 * 2! = 3 * 2 * 1! = 6`
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
importance: 5

---
# 피보나치 수

# Fibonacci numbers
피보나치 수는 다음과 같은 공식을 가집니다 [Fibonacci numbers](https://en.wikipedia.org/wiki/Fibonacci_number)
<code>F<sub>n</sub> = F<sub>n-1</sub> + F<sub>n-2</sub></code>. 즉, 다음 숫자는 앞의 두 숫자의 합계입니다.

The sequence of [Fibonacci numbers](https://en.wikipedia.org/wiki/Fibonacci_number) has the formula <code>F<sub>n</sub> = F<sub>n-1</sub> + F<sub>n-2</sub></code>. In other words, the next number is a sum of the two preceding ones.
처음 두 숫자는`1`,`2 (1 + 1)`,`3 (1 + 2)`,`5 (2 + 3)`등등입니다 :`1, 1, 2, 3, 5 , 8, 13, 21 ...`.

First two numbers are `1`, then `2(1+1)`, then `3(1+2)`, `5(2+3)` and so on: `1, 1, 2, 3, 5, 8, 13, 21...`.
피보나치 수는 [황금 비율](https://en.wikipedia.org/wiki/Golden_ratio)과 우리 주변의 많은 자연 현상과 관련이 있습니다.

Fibonacci numbers are related to the [Golden ratio](https://en.wikipedia.org/wiki/Golden_ratio) and many natural phenomena around us.
`n 번째 '피보나치 수를 반환하는 함수`fib (n)'을 작성하세요.

Write a function `fib(n)` that returns the `n-th` Fibonacci number.

An example of work:
예를 들면

```js
function fib(n) { /* your code */ }
Expand All @@ -22,4 +22,4 @@ alert(fib(7)); // 13
alert(fib(77)); // 5527939700884757
```

P.S. The function should be fast. The call to `fib(77)` should take no more than a fraction of a second.
P.S. 이 기능은 빠릅니다. `fib (77)`에 대한 호출은 1 초도 걸리지 않습니다.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
importance: 5

---
# 단일 연결 리스트 출력하기

# Output a single-linked list

Let's say we have a single-linked list (as described in the chapter <info:recursion>):
단일 연결 리스트가 있다고 가정 해 봅니다 (<info:recursion>):

```js
let list = {
Expand All @@ -22,8 +21,8 @@ let list = {
};
```

Write a function `printList(list)` that outputs list items one-by-one.
목록 항목을 하나씩 출력하는`printList (list)`함수를 작성해보세요.

Make two variants of the solution: using a loop and using recursion.
반목문을 사용하고 재귀적인 방법을 사용해서 두 가지로 접근해봅니다.

What's better: with recursion or without it?
어떤 게 더 좋은 코드인가요? 재귀가 있는 것인가요? 없는 것인가요?
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
importance: 5

---
# 단일 연결 리스트를 역순으로 출력하기

# Output a single-linked list in the reverse order
이전 작업의 단일 연결 목록을 역순으로 출력합니다. <info:task/output-single-linked-list>

Output a single-linked list from the previous task <info:task/output-single-linked-list> in the reverse order.

Make two solutions: using a loop and using a recursion.
반목 문을 사용하는 것과 재귀적인 방법을 사용하는 것 두 가지를 만들어보세요.
Loading