How to use optional chaining with array in Typescript? : <p>I'm trying to use optional chaining with array instead of object but not sure how to do that:</p>

<p>Here's what I'm trying to do <code>myArray.filter(x =&gt; x.testKey === myTestKey)?[0]</code>.</p>

<p>But it's giving error like that so how to use it with array.</p>
