# Create a Priority Queue Class return item with higher priority issue

**URL:** <https://forum.freecodecamp.org/t/create-a-priority-queue-class-return-item-with-higher-priority-issue/323992>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [October 25, 2019, 2:43pm UTC](https://forum.freecodecamp.org/t/create-a-priority-queue-class-return-item-with-higher-priority-issue/323992 "2019-10-25T14:43:36Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![lendoo](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lendoo/32/177827_2.png) [@lendoo](https://forum.freecodecamp.org/u/lendoo)\
**Post date:** [October 25, 2019, 4:48pm UTC](https://forum.freecodecamp.org/t/create-a-priority-queue-class-return-item-with-higher-priority-issue/323992/7 "2019-10-25T16:48:08Z")

</div>

Thank you very much indeed for your help… At least I found the issue. From the array have to delete the first element, not the last. I changed the pop() method, and now I pass the test

Thanks.

P.s: Once I pass a test I always go to see other solutions on the forum to check different solutions and take some idea how to resolve problems on other way…  
[The solution of guide](http://forum.freecodecamp.org/t/freecodecamp-challenge-guide-create-a-priority-queue-class/301630) is very difficult. I tried to understood the logic, but at least I gave up…

---

_[View the full topic](https://forum.freecodecamp.org/t/create-a-priority-queue-class-return-item-with-higher-priority-issue/323992)._
