Echo JS 0.11.0

<~>

tracker1 comments

tracker1 1716 days ago. link 1 point
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.
tracker1 1718 days ago. link 1 point
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;
      }
    }
tracker1 1718 days ago. link 1 point
If you *REALLY* don't like ternary operators...

    function ite(condition, thenValue, elseValue) {
      if (condition) return thenValue;
      return elseValue;
    }
tracker1 1720 days ago. link 1 point
This site is for english content... see about page.
tracker1 1720 days ago. link 1 point
I think that Cloudflare workers are a great idea, and could be awesome for some projects.  I'm not sure there's a self-hosted option as a migration strategy though...  Short of an open platform to self-host at least for development, it just feels like the ultimate lock-in strategy.
[more]