I realised that the first line of this function will always make it always return “No such contact” if the name passed isn’t the first array item. I have a surface understanding of this. Can someone please explain further?
Not really, Kindly explain it to me
Think of what return is actually doing in your for loop.
Thanks for explaining. Is there any other way to do this without moving that block of code outside the for-loop?
Wow, it’s super clear now… Thanks @camperextraordinaire. it’s 3:26am here, I can now go to bed
1 Like