Array#include?() : include?() is a Array class method checks if the argumented object is present in the array or not.
Parameter: obj – element to find
Return: true – if the element is present; otherwise false
Code #1 : Example for include?() method
include? : true include? : false include? : true
Code #2 : Example for include?() method
include? : false include? : false include? : true
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.