forked from ga-wdi-exercises/checkpoint-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oojs.js
33 lines (23 loc) · 1006 Bytes
/
oojs.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
// NOTE: Make sure to use the `var` keyword for ALL variable declarations
// #1: Define a `Playlist` class with the following properties:
// - a `title` property that is a string determined by some input (passed into the constructor)
// - a `songs` property that is an empty array not determined by input (not passed into the constructor)
// - an `addSong` method that adds a song (string) to the `songs` array
// Type your solution immediately below this line:
class Playlist () {
constructor('title')
songs = [" "]
}
addSong () {
console.log('song')
}
// #2: Create an instance of the Playlist class and set it to a variable called `myPlaylist`
// Call the instance's `addSong` method to add a song to the instance's `songs` array
// Type your solution immediately below this line:
var myPlaylist = new Playlist (console.log(addSong))
// NOTE: THE CODE BELOW IS FOR TESTING PURPOSES. DO NOT REMOVE OR ALTER.
if(typeof Playlist !== 'undefined') {
module.exports = {
Playlist
}
}