1. Meaning of 'dollar sign'($) and 'underscore'( _ ) in JS
a. dollar sign( $ )
- 특정 함수로의 shortcut을 의미
- 보통, document.getElementById()를 가르킴
e.g., $("div-id") === document.getElementById("div-id")
- 보통, document.getElementById()를 가르킴
- 변수 앞에 붙이면, 보통 jquery 객체를 의미함
b. underscore( _ )
- class member 중, private member를 의미
https://www.thoughtco.com/and-in-javascript-2037515
What's In a Name? Understanding $ and _ in JavaScript
The $ and _ characters in JavaScript are identifiers that are considered to be letters rather than special characters.
www.thoughtco.com
'TIL(Today I Learned) > 2021년' 카테고리의 다른 글
12.15 - cloudfalre cache로 일어날 수 있는 문제들 (0) | 2021.12.15 |
---|---|
12.03 - useCallback은 정확히 언제? (0) | 2021.12.03 |
11.30 - Currying으로 onClick handler 함수 깔끔하게 작성하기 (0) | 2021.11.30 |
11.29 - Generic Component (0) | 2021.11.29 |
11.19 - 리디북스에서 React 사용법 (0) | 2021.11.19 |