Check out example codes for "if vector contains value c++". It will help you in understanding the concepts better.

Code Example 1

#include <algorithm>

if(std::find(v.begin(), v.end(), x) != v.end()) {
    /* v contains x */
} else {
    /* v does not contain x */
}

Learn ReactJs, React Native from akashmittal.com