본문 바로가기

타쿠꺼

검색하기
타쿠꺼
프로필사진 kimtaku

  • 분류 전체보기 (71)
    • Daily Study (13)
    • Web Study (12)
    • ETC. (3)
    • HTML (4)
      • Study (0)
      • Reference (3)
      • Problem (1)
    • CSS (14)
      • Study (6)
      • Reference (7)
      • Problem (1)
    • Javascript (16)
      • Study (11)
      • Reference (5)
      • Problem (0)
    • jQuery (3)
      • Study (2)
      • Reference (1)
      • Problem (0)
    • PHP (0)
    • Book (1)
    • Font (4)
      • Korean (1)
      • English (3)
      • etc (0)
    • Brackets (1)
    • Skin (0)
      • Data (0)
    • Photoshop (0)
    • Illustrator (0)
Guestbook
Notice
Recent Posts
Recent Comments
Link
  • 문스토리
«   2025/08   »
일 월 화 수 목 금 토
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Tags
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Javascript/Study (11)

타쿠꺼

this 바인딩

this 자바스크립트에서 this는 1. 메서드에서 호출되는 경우, 해당 메서드를 호출한 객체에 바인딩됨.2. 함수에서 호출되는 경우, 전역객체에 바인딩됨(js에선 window) 2의 경우가 문제인데, 만약 메서드 내에 함수를 정의하는 경우 해당 함수의 this는 메서드가 있는 객체에 바인딩되는게 아니라 전역객체에 바인딩 된다. 123456789101112131415161718192021222324var value = 100; var myObject = { value: 1, func1: function() { this.value += 1; console.log('func1() called. this.value: ' + this.value); var func2 = function() { this.value..

Javascript/Study 2016. 5. 29. 04:19
Prev 1 2 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바