Deque.prototype.extend = function (iterable) {
    for (const x of iterable) {
        this.append(x);
    }