-
-
Notifications
You must be signed in to change notification settings - Fork 458
Iman week 9 #1023
base: manchester3
Are you sure you want to change the base?
Iman week 9 #1023
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work Iman
Except for the small bugs, all good !
@@ -15,6 +15,10 @@ Take a look at the following code: | |||
|
|||
Explain why line 4 and line 6 output different numbers. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the PR to be against Manchester3 branch instead of master, ensure to check this as it may cause problems if people started adding comments :)
@@ -61,3 +68,5 @@ console.log(y); | |||
``` | |||
|
|||
What will be the output of this code. Explain your answer in 50 words or less. | |||
first console.log output is 9, | |||
second console.log is an object: x: 9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is a bit tricky, search passing by value vs passing by reference
cartContains() { | ||
// Use console.log() to output everything contained in your cart | ||
console.log(this.myBasket); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect
|
||
// Add your code here | ||
constructor(amount) { | ||
this.amount = amount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a small issue here, your constructure require an argument, but when you created an instance of the class in line 19 you didn't pass it.
The question will be, do you need the other variable ? amount ?
//Add some songs to your playlist | ||
myMusicPlayer.add("Bohemian Rhapsody", "Queen"); | ||
myMusicPlayer.add("Yesterday", "The Beatles"); | ||
myMusicPlayer.add("Vogue", "Madonna"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work!
Your Details
Your Name: Iman
Your City: Manchester
Your Slack Name: Iman-feisali
Homework Details
Module: JavaScript
Week: 9