문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
wiki:javascript:javascript_note:js_arrow_function [2021/04/26 14:47] emblim98 [What About ''this''?] |
wiki:javascript:javascript_note:js_arrow_function [2023/01/13 18:44] (현재) |
||
|---|---|---|---|
| 줄 91: | 줄 91: | ||
| 일반 함수를 사용하면, | 일반 함수를 사용하면, | ||
| <code javascript> | <code javascript> | ||
| + | let hello; | ||
| + | hello = function () { | ||
| + | document.getElementById(" | ||
| + | } | ||
| + | |||
| + | // The window object calls the function: | ||
| + | window.addEventListener(" | ||
| + | |||
| + | // A button objects calls the function: | ||
| + | document.getElementById(" | ||
| + | // [object Window][object HTMLButtonElement] | ||
| </ | </ | ||
| \\ | \\ | ||
| 줄 98: | 줄 109: | ||
| \\ | \\ | ||
| <code javascript> | <code javascript> | ||
| + | let hello; | ||
| + | |||
| + | hello = () => { | ||
| + | document.getElementById(" | ||
| + | } | ||
| + | |||
| + | // The window object calls the function: | ||
| + | window.addEventListener(" | ||
| + | // A button objects calls the function: | ||
| + | document.getElementById(" | ||
| + | // [object Window][object Window] | ||
| </ | </ | ||
| 함수로 작업할 때 이러한 차이점을 기억하십시오.\\ | 함수로 작업할 때 이러한 차이점을 기억하십시오.\\ | ||