alternative for include in typescript

Solutions on MaxInterview for alternative for include in typescript by the best coders in the world

showing results for - "alternative for include in typescript"
Celian
24 Oct 2019
1let shoppingList: string[] = [
2  'Eggs',
3  'Milk',
4  'Fish',
5  'Apple',
6  'Bread',
7  'Chicken',
8];
9
10function isThere(arr: string[]): void {
11  let there1: boolean = arr.indexOf('Milk') > -1;
12  let there2: boolean = arr.indexOf('Banana') > -1;
13
14  console.log(there1);
15  console.log(there2);
16}
17
18isThere(shoppingList);
19