Algorithms and Data Structures · Middle · Question 12 of 75

Does JavaScript have a built-in priority queue?

Explanation

There's no built-in heap in JavaScript. Map keeps insertion order, not priority. In interviews you either implement a small binary heap or explain that you'd use one from a library.

Further reading

Problem with a question

Algorithms and Data Structures · Middle · question 12

Test yourself

Take the Algorithms and Data Structures · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz