creating own javascript join and push methods
first of all you can use the &quot;new&quot; class syntax instead of changing the prototype directly.
This is how I would do it:
class Errey {
    #currentArray;

    constructor(...elements) {
        this.#currentArray = elements;
    }

    get errey() {
        return this.#currentArray;
    }

    push(...elements) {
        const startLength = this.#currentArray.length;
        elements.forEach((curEl, index) =&gt; this.#currentArray[index + startLength] = curEl);
        return this.#currentArray.length;
    }

    join(union = &quot; &quot;) {
        return this.#currentArray.reduce((prev, cur) =&gt; prev + union + cur);
    }
}

//run a few examples
const myArray = new Errey(&quot;3&quot;,&quot;blue&quot;,&quot;1&quot;,&quot;brown&quot;)

console.log(myArray.join(&quot;, &quot;));
console.log(myArray.push(&quot;Subscribe&quot;, &quot;To&quot;, &quot;Him&quot;));
console.log(myArray.errey);

push:
the standard array.prototype.push allows for multiple elements to be added at once, so I allow multiple elements and loop over them using forEach, you could also do [...this.#currentArray, ...elements] (or use Array.prototype.concat()).
join:
here I use reduce to create a join operation. Reduce takes the first 2 elements and applies a function on them (in this case a + union + b), makes them the new first element and repeats that until there is only one element left, our joined erray.
I also made the internal Array private using the prefixed # and created a getter (get errey()) instead, this way the internal array can only be changed using the push method.
Using the factory pattern (which I personally prefer):
const Errey = (...elements) =&gt; {
    
    const push = (...newElements) =&gt; {
        const startLength = elements.length;
        newElements.forEach((curEl, index) =&gt; elements[index + startLength] = curEl);
        return elements.length;
    };

    const join = (union = &quot; &quot;) =&gt; elements.reduce((prev, cur) =&gt; prev + union + cur);

    const get = () =&gt; elements;

    return {
        push,
        join, 
        get,
    };
};

const myArray = Errey(&quot;3&quot;,&quot;blue&quot;,&quot;1&quot;,&quot;brown&quot;)

console.log(myArray.join(&quot;, &quot;));
console.log(myArray.push(&quot;Subscribe&quot;, &quot;To&quot;, &quot;Him&quot;));
console.log(myArray.get());