Possibly Undefined Error

I have two arrays that I am expecting to contain the same values, but possibly in a different order. Example Arr1 = [1, 2, 3] Arr2 = [3, 1, 2] However, it is possible that they do NOT contain the same values, and this should be treated as an error in my api. TypeScript is detecting this, but does not seem to be smart enough to know I am checking that they contain the same values. How can I fix this? Thanks!
2 Replies
Want results from more Discord servers?
Add your server