JS 변수에서 $나 _를 왜 쓰는걸까?
2023. 7. 30. 19:57ㆍLayover
참고로 나는 제이쿼리를 모른다. 근데 종종 강의나 유튜브를 보면 변수에 $나 _를 쓰는 경우를 심심치 않게 볼 수 있다.
한국어로 찾으니 getElementById 축약이라고 보통 이야기하는데 내가 봤을 때 이런 경우를 찾는 것 같지는 않았다. 그래서 영문으로 찾아보았다.
Why JavaScript Variable Starts with a Dollar Sign??
https://stackoverflow.com/questions/205853/why-would-a-javascript-variable-start-with-a-dollar-sign
https://www.geeksforgeeks.org/why-javascript-variable-starts-with-a-dollar-sign/
Why JavaScript Variable Starts with a Dollar Sign ? - GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
www.geeksforgeeks.org
여러 글이 있지만... 결론은 그냥 유니크한 변수임을 나타내기 위해서 사용하는 듯하다....
'Layover' 카테고리의 다른 글
웹팩을 이해해보자 (0) | 2023.09.25 |
---|---|
'json-server'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는배치 파일이 아닙니다. (0) | 2023.09.23 |
항상 알겠는데 모르겠는 번들러를 이해해보자 (0) | 2023.09.19 |
[공식문서 나들이] Mongoose에서 .lean()은 무엇일까? (0) | 2023.08.14 |
[MongoDB] MongoDB 6.0 다운로드 방법 (비전공자를 위한...) (1) | 2023.02.17 |