Stub functions in an array javascript
<p>I am trying to stub a set of functions in javascript, by changing directly the implementation, like this (assume fnOne and stub are functions): </p>

<p><code>fnOne = stub;</code></p>

<p>This works, however, to simplify the code I would like to add N functions to an array, and then stub them all, like this:</p>

<pre><code>function fnOne() {return 'fnOne';}

function fnTwo() {return 'fnTwo';}

let fnArray = [fnOne, fnTwo];

function fnStub() {return 'stub';}

fnArray[0]()
"fnOne"

fnOne();
"fnOne"

fnArray[0] = fnStub()
"stub"

fnOne();
"fnOne" //I wanted to stub fnOne, that was in an array.
</code></pre>

<p>Is that possible in javascript? I know that I an in fact altering the array, not the function, but I wonder if that is possible somehow.</p>