Yes,and when console.log the latter arrays in contacts,it does not read them,that is the function only reads the array containing Akira,but does not the ones of Harry,Sherlock and Kristian.
When I console.log the latter arrays in contacts,it does not read them,that is the function only reads the array containing Akira,but does not the ones of Harry,Sherlock and Kristian.
@harshalc, your if statement that is checking the name is the problem. The question is why.
Any time your code encounters a return execution stops. You code, as, written, will always stop execution on the first loop iteration. This isn’t quite what you want, right?