I've found if you try and get the length and no results were returned it errored as there is no "length" to check.
I got in to the habit of doing if(!!searchBankCode && searchBankCode.length>0).
However you could just use a "for each" loop and not bother checking, really depends on how you're used to writing these things I guess. 😉
There's probably a "correct" way or "most efficient" way but everything I know is what I've learnt on the job or spending time looking online over the past 20+ years coding and works for me.
TBH it's one reason I don't often reply to people in the thread, always feel I'm going to get frowns off people! 😉