How do you check an array if a string contains the same text? Example, I have cards array that I declare and I want to find how many have the same string like clubs in my array. I tried using includes using jquery and it returns a boolean function true or false. What should be done here? Will it possible to use the find method in the array? Please help.
It should alert that an array has 3 strings that has the same value like clubs.
$(document).ready(function() {
var cards = ["ace_of_clubs.png","2_of_clubs.png","3_of_clubs.png","ace_of_hearts.png"];
var f_string = cards.includes("clubs");
alert(f_string);
});