-
Notifications
You must be signed in to change notification settings - Fork 374
Expand file tree
/
Copy pathobjectReview.js
More file actions
72 lines (33 loc) · 2.05 KB
/
Copy pathobjectReview.js
File metadata and controls
72 lines (33 loc) · 2.05 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
//Make a 'favoriteThings' object that contains the following keys: band, food, person, book, movie, holiday. Have the values to those keys be your favorite thing in that category.
//Your code here
//After you've made your object, add another key named 'car' with the value being your favorite car and then another key named 'brand' with the value being your favorite brand.
//Your code here
//Now change the food key in your favoriteThings object to be 'Lettuce' and change the book key in your favoriteThings object to be '50 Shades of Gray'.
//Your code here
//Now, alert your favorite person, then alert your favorite book.
//Your code here
/* NEXT PROBLEM - NEXT PROBLEM - NEXT PROBLEM */
var user = {
name: 'Tyler McGinnis',
email: null,
pwHash: 'U+Ldlngx2BYQk',
birthday: undefined,
username: 'tylermcginnis33',
age: 0
}
//Above you're given a user object. Loop through the user object checking to make sure that each value is truthy. If it's not truthy, remove it from the object. hint: 'delete'.
//Your code here
//Once you get your truthy object, Change the remaining values in the object to be specific to you (name: 'your name', username: 'your username'), rather than my information.
//Your code here
//Now console.log your object and make sure it looks right.
//Your code here
/* NEXT PROBLEM - NEXT PROBLEM - NEXT PROBLEM */
//create an empty object called methodCollection.
//Your code here
//Now add two methods (functions that are properties on objects) to your methodCollection object. One called 'alertHello' which alerts 'hello' and another method called logHello which logs 'hello' to the console.
//Your code here
//Now call your alertHello and logHello methods.
//Your code here
/* NEXT PROBLEM - NEXT PROBLEM - NEXT PROBLEM */
//write a function called voweler that accepts a string, and returns an object with the keys being all the vowels in that string, and the values being how many times that particular vowel was in the string.
//voweler("This is a test") --> {i: 2, a: 1, e: 1};