320x100 Study31 [JS] 호이스팅(Hoisting)이란 무엇인가?? Javascript를 사용 하다보면 호이스팅 이라는 말을 들어본 적이 있을 것이다. 실제로 나도 호이스팅 이라는 말을 들어본 적만 있고, 개념이 제대로 잡혀있는 것 같지 않아 블로그에 보기 좋기 정리하려고 한다. 들어가기에 앞서 호이스팅은 let과 const가 추가된 ES2015(ES6)에서부터 var를 사용하지 않으면서 중요도가 떨어졌다. 그래도 자바스크립트의 실행 환경을 이해하기 위해 알아두면 좋을 것 같다. Hoisting의 뜻 네이버 영어사전을 통해 알아본 호이스팅의 뜻은, "끌어 올리기" 이다. 무엇을 끌어올린다는 것일까? 선언을 끌어올린다 MDN web Docs에서는 호이스팅을 "변수의 선언과 초기화를 분리한 후, 선언만 코드의 최상단으로 옮기는" 것 이라고 말하고 있다. 코드를 보면서 어떤 .. 2021. 11. 6. [JS] this 부터 call, apply, bind 까지 내가 다른 언어보다 JS에서 가장 애를 먹었던 키워드들 중 하나가 this 이다. this에 대해 공부한 내용을 최대한 내 언어로 정리해보려고 한다. this는 무엇인가? JAVA에서의 this는 간단히 말하면 해당 인스턴스를 가리키는 키워드이다. JS에서도 클래스의 인스턴스 내에서 this를 사용하면 해당 객체를 가리키게 된다..만, JS의 this는 조금 다른 의미를 가지고 있다. this는 기본적으로 전역 객체를 가리킨다 Chrome 브라우저에서 개발자 도구 콘솔을 열고 this를 입력해보면 다음과 같이 나온다. 이렇게 Window 객체가 나오는것을 확인할 수 있다. 이번에는 nodejs에서 this를 출력해 본다. nodejs에서 this를 입력하여 확인해보면, 이렇게 global 객체의 정보가 .. 2021. 9. 26. [자료구조]이진 탐색 트리(Binary Search Tree) 정의 In computer science, a binary search tree (BST), also called an ordered or sorted binary tree, is a rooted binary tree whose internal nodes each store a key greater than all the keys in the node's left subtree and less than those in its right subtree. A binary tree is a type of data structure for storing data such as numbers in an organized way. Binary search trees allow binary search for fas.. 2021. 6. 5. [자료구조]우선순위 큐(Priority Queue) 정의 In computer science, a priority queue is an abstract data type similar to a regular queue or stack data structure in which each element additionally has a "priority" associated with it. In a priority queue, an element with high priority is served before an element with low priority. In some implementations, if two elements have the same priority, they are served according to the order in whic.. 2021. 6. 2. 이전 1 2 3 4 5 6 7 8 다음