Skip to content

Commit 2273212

Browse files
committed
1 parent f71e2a7 commit 2273212

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

fundamentals.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ for (i=0; i < foods.length; i++) {
2525
// #5: Create an object literal called `instructor` that contains three key-value pairs.
2626
// Type your solution immediately below this line:
2727

28-
28+
instructor = {
29+
name: "Caio",
30+
age: 25,
31+
favFood: "pizza"
32+
}
2933

3034
// #6: Add a `has-office-hours` (spelled exactly) property to `instructor` by accessing
3135
// it (do not change the original object you typed above) and assigning it
3236
// a boolean value.
3337
// Type your solution immediately below this line:
38+
39+
instructor['has-office-hours'] = false

oojs.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
// Type your solution immediately below this line:
88

99

10-
10+
class Playlist {
11+
constructor(title) {
12+
this.title = title
13+
this.songs = []
14+
}
15+
addSong(song) {
16+
this.songs.push(song)
17+
}
18+
}
1119

1220

1321
// #2: Create an instance of the Playlist class and set it to a variable called `myPlaylist`
@@ -16,8 +24,6 @@
1624

1725

1826

19-
20-
2127
// NOTE: THE CODE BELOW IS FOR TESTING PURPOSES. DO NOT REMOVE OR ALTER.
2228
if(typeof Playlist !== 'undefined') {
2329
module.exports = {

0 commit comments

Comments
 (0)