We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 743eb00 commit a69e60bCopy full SHA for a69e60b
index.js
@@ -255,13 +255,15 @@ Queue.prototype.push = function (item) {
255
return this.tail.push(item);
256
};
257
258
-Queue.prototype.length = function () {
259
- return this.head.length - this.offset + this.tail.length;
+Queue.prototype.forEach = function () {
+ var array = this.head.slice(this.offset);
260
+ array.push.apply(array, this.tail);
261
+ return array.forEach.apply(array, arguments);
262
263
264
Object.defineProperty(Queue.prototype, 'length', {
265
get: function () {
- return this.array.length;
266
+ return this.head.length - this.offset + this.tail.length;
267
}
268
});
269
0 commit comments