Question about arrays and include method

I need help to list the items in an array that makes the include method true.
I have this so far

if(array.include(string){
return newArray
}

i’ve beenm struggling to find out how to list the new array with onlythe items inside tthe array with the same string as the input string

for example.
array=[ chocolate cake, chocolate fudge, vanilla, banana]
string =choc olate
return i’m looking for
newArra=[chocolate cake, chocolate fudge];

You could use filter:

const array = ['chocolate cake', 'chocolate fudge', 'vanilla', 'banana'];
const string = 'chocolate';
const newArray = array.filter((item) => item.includes(string));