Skip to content

#37 06 advanced function 10 bind #44

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

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
#39 Re-Commit Grammar Check
  • Loading branch information
singularity-code authored and Chris committed May 15, 2019
commit 29bc7f3926e36ce565a887532bdbde17095c3fd8
4 changes: 2 additions & 2 deletions 1-js/06-advanced-functions/07-new-function/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sayHi(); // Hello

예전의 모든 선언문에서 함수의 코드는 스크립트 안에서 쓰였습니다.

그러나 `new Function` 이라는 문법은 어떠한 문자열을 함수로 바꾸어주는 역활을 합니다. 예를 들면, 새로운 함수를 서버로 받아서 실행해야 될 때 처럼입니다.
그러나 `new Function` 이라는 문법은 어떠한 문자열을 함수로 바꾸어주는 역활을 합니다. 예를 들면, 새로운 함수를 서버로 받아서 실행해야 할 때처럼입니다.

```js
let str = ... receive the code from a server dynamically ...
Expand Down Expand Up @@ -83,7 +83,7 @@ getFunc()(); // *!*"test"*/!*, from the Lexical Environment of getFunc

특수한 기능인 `new Function`이 이상해 보일 수 있습니다만 아주 유용할 때가 있습니다.

문자열로부터 함수를 만들어야 하는 상황이 있어야 된다고 생각해보면. 그 함수의 코드는 스크립트를 작성할 때는 알 수 없습니다. (그래서 보통 함수를 사용하지 않죠) 그러나, 실행되는 프로세스에서는 알 수 있습니다. 서버 또는 다른 출처로 부터 받게 되겠지요.
문자열로부터 함수를 만들어야 하는 상황이 있어야 한다고 생각해보면. 그 함수의 코드는 스크립트를 작성할 때는 알 수 없습니다. (그래서 보통 함수를 사용하지 않죠) 그러나, 실행되는 프로세스에서는 알 수 있습니다. 서버 또는 다른 출처로부터 받게 되겠지요.

새로운 함수는 메인 스크립트와 상호작용해야 할 것입니다.

Expand Down