Currently facing an issue while filtering an array. Whenever the filtered field is null, it triggers an error causing the rest of the code to fail. This is how my code looks like:
this.order= result.headerText.find((item) => item.textType === 'Order');
Everything works fine if texttype is 'Order', but if it's null, an error occurs and the subsequent code doesn't get executed.
https://i.sstatic.net/Z4Uhy.png
Seeking a way to check for the presence of textType with 'Order' and return it without crashing when it's null :)