다음과 같이 enqueue와 dequeue메서드를 포함한 클래스가 있다. class PriorityQueue { constructor() { this.store = []; } enqueue(item) { this.store.push(item); } dequeue() { let start = 0; this.store.forEach((item, index) => { if (this.store[start][1] > this.store[index][1]) { // 가장 작은것을 찾음 start = index; } }); return this.store.splice(start, 1); } } 처음에는 아래의 코드 처럼 dequeue를 만들때 sort를 한다음 맨 처음의 값을 shift를 통해서 빼려고 했다. 하지..