-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqno29.ts
21 lines (20 loc) · 972 Bytes
/
qno29.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Qno. 29
// Favorite Fruit: Make a array of your favorite fruits, and then write a series of independent if statements that check for certain fruits in your array.
// • Make a array of your three favorite fruits and call it favorite_fruits.
// • Write five if statements. Each should check whether a certain kind of fruit is in your array. If the fruit is in your array, the if block should print a statement, such as You really like bananas!
let Favorite_fruits:string[]=["Pineapple", "Strawberreys","Oranges"]
if (Favorite_fruits.includes('Apples')){
console.log("I really like Apples")
}
if (Favorite_fruits.includes('Strawberreys')){
console.log("I really like Strawberreys")
}
if (Favorite_fruits.includes('Oranges')){
console.log("I really like Oranges")
}
if (Favorite_fruits.includes('Mango')){
console.log("I really like Mango")
}
if (Favorite_fruits.includes('Pineapple')){
console.log("I really like Pineapple")
};