-
-
Notifications
You must be signed in to change notification settings - Fork 419
Expand file tree
/
Copy path300.js
More file actions
24 lines (21 loc) · 639 Bytes
/
300.js
File metadata and controls
24 lines (21 loc) · 639 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Predict and explain...
// What will happen when this program is run?
// Check your prediction and explanation by running the program.
// Fix anything that needs fixing.
function checkLivesNearCYF(person) {
console.log(person);
const cyfLocations = ["Birmingham", "Cape Town", "Glasgow", "London", "Manchester"];
return cyfLocations.includes(person.location);
}
const mo = {
"name": "Mo",
"city": "Glasgow",
"focus": "React",
};
const sayed = {
"name": "Sayed",
"city": "Edinburgh",
"focus": "SQL",
}
console.assert(checkLivesNearCYF(mo)); //True
console.assert(!checkLivesNearCYF(sayed)); //False