-
Notifications
You must be signed in to change notification settings - Fork 19
/
exercises.js
107 lines (85 loc) · 2.97 KB
/
exercises.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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Comments are text that will not be executed in your code. Rather comments are for other programmers to read.
// Single line comments start with //
/* Multiple line comments start with*/ /* and end with */
/* All of the exercises below are commented out. Write your Javascript code after each exercise. */
/* Variables and Data Types */
/*Console.log each variable and test your code in the terminal using the Node REPL*/
/*i.e.*/
let fruit = 'banana';
console.log(fruit); // <= this should print out 'banana'
/*
* #1
* Variables with a STRING value
Declare the following variables and assign your own string values for each variable. Console.log each variable to check your work.
firstName
lastName
birthPlace
favColor
favFood
*/
/*
* #2
* Variables with a Number value
Declare the following variables and assign your own number values for each variable. Console.log each variable to check your work.
age
shoeSize
mcdonaldsInHi
abcStoresInHi
princeSong
*/
/*
* #3
* Variables with a BOOLEAN value
Declare the following variables and assign your own boolean values for each variable. Console.log each variable to check your work.
lovesMcdonalds
isVegan
olderThan21
hasNetFlix
beenToParis
*/
/*
* #4
* Variables with an ARRAY value
Declare a variable named plateLunch and assign it an array containing five of your favorite lunch items.
Declare a variable named `candyBox` and assign it an array containing five candies of your choosing.
Declare a variable named `westSiiiiide` and assign it an array containing states found on the west coast of the US.
Declare a variable named `lotteryResult and assign it an array containing 5 random numbers.
Declare a variable named `hamajang` and assign it an array containing 6 different data types.
Declare a variable named `tagTeam` and assign it an array containing 3 arrays, with each array containing items that complement with one another.
Console.log each variable to check your work
*/
/*
* #5
* Accessing values in ARRAYS
let partyMenu = ['steak nachos', 'fried rice', 'bbq ribs', 'sweet potato fries', 'chicken wings', 'carrot cake', 'chi chi dango'];
Console.log the entire array.
Console.log the length of this array.
Console.log 'sweet potato fries' from this array.
Console.log 'steak nachos' from this array.
*/
/*
#6
* Concatenation
Concatenate the variables `firstName` and `lastName` from exercise 1 and store them into a new variable called `fullName` (don't forget to include a space between the firstName and lastName).
Using the fullName and birthPlace variables, console.log the following:
"Hi my name is fullName and I was born in birthPlace."
*/
/*
* #7
* Variables with an OBJECT value
Declare the following variables and add your own values to each name to complete the properties for each object. Console.log each variable to check your work.
kicks
- brand
- size
- color
car
- brand
- model
- color
bank
- name
- branch
- location
- rating
- helpful
*/