I don't agree... in FF, the feature was always half baked and hidden... I actually want more/better support for PWAs. Been using Edge a lot more lately, and my biggest complaint is that the "Install This Site As An App" option doesn't set it to it's own instance by default. Some sites can request to become an app, and that seems to work though the header at the top is confusing and probably shouldn't be there.
Even then, the most common use of the feature is with mobile devices.
It shouldn't go away, it's the best counter to app store censorship.
Then use splice if you're really concerned about it... will be O(n) with an n of 2.
Also, have you actually measured the performance cost of Delete... as I mentioned, you're optimizing by using an expensive call.
I'm not sure why one would do this over simply using an array... Delete in particular is a somewhat costly execution penalty.
class Queue {
constructor() {
this._items = [];
}
enqueue(item) {
this._items.push(item);
}
dequeue() {
return this._items.shift();
}
peek() {
return this._items[0];
}
get length() {
return this._items.length;
}
}
I'm not sure why one would do this over simply using an array... Delete in particular is a somewhat costly execution penalty. class Queue { constructor() { this._items = []; } enqueue(item) { this._items.push(item); } dequeue() { return this._items.shift(); } peek() { return this._items[0]; } get length() { return this._items.length; } }If you *REALLY* don't like ternary operators... function ite(condition, thenValue, elseValue) { if (condition) return thenValue; return elseValue; }