README is inconsistent
neomilium opened this issue · comments
Romuald Conty commented
Hello,
I noticed a bug in your README:
// add some items
queue.push(7);
queue.push(5);
queue.push(10);
// remove the top item
var top = queue.pop(); // returns 5
If it returns 5, its not the top. If its the top, documentation should say returns 7
.
Does I miss something?
Volodymyr Agafonkin commented
This is a sorted queue. In this case the "top" refers to the smallest number pushed up to that point.
Romuald Conty commented
OK, thanks.
Maybe that point could be explicitly described in README.