-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathW3D5.js
39 lines (36 loc) · 1.04 KB
/
W3D5.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
-/*
You were put in charge of ordering for tonight's company get-together,
and you were given a data set with people's meal preferences and dietary restrictions.
Write a function called orderAVegetarianDish that takes an array of empoloyee objects,
and returns true if at least 1 person is listed "vegetarian" on their "mealPreferences".
Otherwise, your function should return false.
var staffA = [
{
name: "Lia",
department: "Human Resources",
dietaryRestrictions: [],
mealPreferences: "no preferences"
},
{
name: "Sebastian",
department: "Engineering",
dietaryRestrictions: ["dairy free", "gluten free"],
mealPreferences: "vegetarian"
},
{
name: "Ari",
department: "Executive",
dietaryRestrictions: ["dairy free"],
mealPreferences: "vegetarian"
},
{
name: "Martha",
department: "Legal",
dietaryRestrictions: ["nut allergies"],
mealPreferences: "non-vegetarian"
}
];
Calling your function should result in:
orderAVegetarianDish(staffA); //true
*/
// your answer is here