I am encountering an issue when trying to run the same code in my Typescript application that works fine in the browser console:
[{ssid: 'Test Network 1', rssi: 54},{ssid: 'Test Network 2', rssi: 60}].find((rec) => 'Test Network 1' === rec.ssid).rssi
54
However, Typescript is giving me an error message saying "Object is possibly 'undefined'":
[{ssid: 'Test Network 1', rssi: 54},{ssid: 'Test Network 2', rssi: 60}].find((rec) => 'Test Network 1' === rec.ssid).rssi;
What changes do I need to make to resolve this issue?