Check out example codes for "if(arr[i]==k) return arr[i];". It will help you in understanding the concepts better.

Code Example 1

if(arr[i]==k){
return  arr[i];
}

Learn ReactJs, React Native from akashmittal.com