Check out example codes for "kotlin check if element in array". It will help you in understanding the concepts better.

Code Example 1

// Use the contains() function

var intArray = arrayOf(10, 20, 30, 40, 50)

println(intArray.contains(10))

// Returns true

Learn ReactJs, React Native from akashmittal.com