JavaScript 전역객체

(자바스크립트 전역객체에서 넘어옴)

1 개념[ | ]

JavaScript Global Object
자바스크립트 전역객체
  • 자바스크립트는 최상위에 전역 개체를 가짐
  • 자바스크립트에서 코딩시 전역개체 생략 가능

2 전역 객체 종류[ | ]

  • 웹브라우저 : window
  • Node.js : global

3 주요 전역 객체의 하위 객체[ | ]

  • screen
  • navigator
  • history
  • location
  • document

4 예시[ | ]

  • window 객체의 존재와 무관하게 동작함
var foo = "bar";

document.write(foo); // bar
window.document.write(foo); // bar

5 주요 전역 객체의 하위 메쏘드[ | ]

  • alert()
  • confirm()
  • setInterval()
  • setTimeout()

6 예시[ | ]

  • window 객체의 존재와 무관하게 동작함
var foo = "bar";

alert(foo); // bar
window.alert(foo); // bar

7 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}