-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathpart1.js
More file actions
80 lines (51 loc) · 2.38 KB
/
Copy pathpart1.js
File metadata and controls
80 lines (51 loc) · 2.38 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* =====================
# Lab 2, Part 1 — Underscore Selection
## Introduction
Set variables "query1" through "query8" by using an underscore function to answer the specified question.
When you are finished, check your browser's console log to test the results.
For datan all of the queries, use the following two lists of board games.
===================== */
var jeffGameList = ["chess", "monopoly", "sorry", "pandemic", "candyland"];
console.log('Jeff\'s list', jeffGameList);
var nathanGameList = ["chess", "dice", "catan", "pandemic"];
console.log('Nathan\'s list', nathanGameList);
/* =====================
What is the first game in Jeff's list?
===================== */
var query1;
console.log('What is the first game in Jeff\'s list?', query1);
/* =====================
What are all of the games except for the first game in Jeff's list?
===================== */
var query2;
console.log('What are all of the games except for the first game in Jeff\'s list?', query2);
/* =====================
What is the last game in Nathan's list?
===================== */
var query3;
console.log('What is the last game in Nathan\'s list?', query3);
/* =====================
What are all of the games in Nathan's list except for the last?
===================== */
var query4;
console.log('What are all of the games in Nathan\'s list except for the last?', query4);
/* =====================
What would Nathan's game list look like if he sold "catan"?
===================== */
var query5;
console.log('What would Nathan\'s game list look like if he sold "catan"?', query5);
/* =====================
If Nathan and Jeff play a board game, what are their options? This should be a list of all games owned by Jeff or Nathan, with no duplicates.
===================== */
var query6;
console.log('If Nathan and Jeff play a board game, what are their options? This should be a list of all games owned by Jeff or Nathan, with no duplicates.', query6);
/* =====================
Which games are owned by both Jeff and Nathan?
===================== */
var query7;
console.log('Which games are owned by both Jeff and Nathan', query7);
/* =====================
Which games are exclusive to collections? In other words, only owned by either Jeff or Nathan.
===================== */
var query8;
console.log('Which games are exclusive to one collection? In other words, only owned by either Jeff or Nathan (but not both!).', query8);