Not "how fast is this?" but "what happens when the data gets ten times bigger?"
arr[5] or a Map lookupfilter, includesArray.sort| n = 100 | 10,000 steps | instant |
| n = 1,000 | 1,000,000 | noticeable |
| n = 10,000 | 100,000,000 | the page freezes |
It works perfectly with your test data and dies in production. That is the whole story of most performance incidents.
O(2n) is written O(n). Big-O describes the SHAPE of growth, not the exact cost. A well-written O(n²) can beat an O(n) one at small sizes, which is why you measure as well as reason.