자바스크립트 공부 사이트
https://developer.mozilla.org/en-US/docs/Web/API/Document/elementFromPoint
Document: elementFromPoint() method - Web APIs | MDN
The elementFromPoint() method, available on the Document object, returns the topmost Element at the specified coordinates (relative to the viewport).
developer.mozilla.org
script async와 defer의 차이점
1. <head> 안에 <script>를 넣는 경우
2. <body>의 가장 끝에 <script>를 넣는 경우
3. <head> 안에서 <script async src="#"> 를 주는 경우
=> fetching, executing 작업을 비동기적으로 실행 (executing 시간에는 블락됨)
4. <head> 안에서 <script defer src="#"> 를 주는 경우
=> js파일을 먼저 fetching해두고 돔에 html이 모두 연결된 이후에 js를 실행시킨다.
use strict
순수 바닐라 자바스크립트를 쓸 때는 'use strict'; 를 적어주는 것이 좋다.
유연한 자바스크립트를 좀 더 엄격하게 관리해준다. (선언되지 않는 변수를 사용하는 등..)
https://www.youtube.com/watch?v=tJieVCgGzhs&list=PLv2d7VI9OotTVOL4QmPfvJWPJvkmv6h-2&index=2
'JavaScript' 카테고리의 다른 글
[JavaScript] event.target 과 event.currentTarget 차이 (0) | 2024.11.27 |
---|---|
[JavaScript] 자바스크립트 디버깅하기 (0) | 2024.11.21 |
[JS] 이벤트 버블링 (event bubbling) (2) | 2024.09.01 |
[JavaScript] null & undefined 에 대해 알고싶다.. (0) | 2024.07.08 |
[JavaScript] Virtual Scroll 구현하기(feat.Intersection Observer) (0) | 2024.07.02 |