Skip to content

eval 번역#167

Closed
1000peach wants to merge 1 commit intojavascript-tutorial:masterfrom
1000peach:eval
Closed

eval 번역#167
1000peach wants to merge 1 commit intojavascript-tutorial:masterfrom
1000peach:eval

Conversation

@1000peach
Copy link
Contributor

eval/article.md 번역 입니다. 리뷰 부탁드립니다.

문자열 코드는 길거나 줄 바꿈, 함수 선언, 변수 등을 포함 할 수 있습니다.

The result of `eval` is the result of the last statement.
`eval`은 마지막 문의 결과를 반환합니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`eval`은 마지막 문의 결과를 반환합니다.
`eval`은 마지막 구문의 결과를 반환합니다.

가 어떨까요?

모던 프로그래밍에서 `eval`은 거의 사용되지 않습니다. 흔히 "eval is evil"라고 합니다.

The reason is simple: long, long time ago JavaScript was a much weaker language, many things could only be done with `eval`. But that time passed a decade ago.
이유는 간단합니다. 오래 전, JavaScript는 훨씬 더 약한 언어였고 많은 것을 `eval`만 사용하여 실행했습니다. 하지만 그 때는 10년 전에 지나갔습니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10년 전에 지나갔습니다 라는 표현이 어색한 것 같아요 아래와 같은 표현은 어떤가요?

Suggested change
이유는 간단합니다. 오래 전, JavaScript는 훨씬 더 약한 언어였고 많은 것을 `eval`만 사용하여 실행했습니다. 하지만 그 때는 10년 전에 지나갔습니다.
이유는 간단합니다. 오래 전, JavaScript는 훨씬 더 약한 언어였고 많은 것을 `eval`만 사용하여 실행했습니다. 하지만 10년이 흘렀습니다.

- Can access outer local variables. That's considered bad practice.
- Instead, to `eval` the code in the global scope, use `window.eval(code)`.
- Or, if your code needs some data from the outer scope, use `new Function` and pass it as arguments.
`eval(code)`을 호출하면 코드 문자열을 실행하고 마지막 문의 결과를 반환합니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

역시 보다는 구문이라 표현해줘야 명확할 것 같습니다.

Suggested change
`eval(code)`을 호출하면 코드 문자열을 실행하고 마지막 문의 결과를 반환합니다.
`eval(code)`을 호출하면 코드 문자열을 실행하고 마지막 구문의 결과를 반환합니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

역시 보다는 구문이라 표현해줘야 명확할 것 같습니다.

반영하겠습니다. 감사합니다 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants