-
-
Notifications
You must be signed in to change notification settings - Fork 454
Altom-week-9 #1032
base: manchester3
Are you sure you want to change the base?
Altom-week-9 #1032
Conversation
lannem
left a comment
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.
Really well done Altom 💯
|
|
||
| Explain why line 4 and line 6 output different numbers. | ||
| Explain why line 4 and line 6 output different numbers? | ||
| Because line 4 is global variable and line 6 is local variable |
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.
Other way around, line 4 is local and line 6 is global :)
|
|
||
| What will be the output of this code. Explain your answer in 50 words or less. | ||
|
|
||
| The output will 10 for the console.log of x and and undefined because of the y is not defined outside the function f1() |
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.
Correct! You missed an explanation of console.log(f1()) though
| What will be the output of this code. Explain your answer in 50 words or less. | ||
|
|
||
| The console.log of x will be 9 and the f1() will not give any output because we did not console.log it. | ||
| The console.log of y will be { x: 9 } and the f2() will not give any output because we did not console.log it |
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.
Correct :) well done!
|
|
||
| cartContains() { | ||
| // Use console.log() to output everything contained in your cart | ||
| console.log(`Your shopping cart has ${this.length} items: ${this.item}`); |
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.
Well done!
| greeting() { | ||
| console.log("Hi! I'm " + this.name + "."); | ||
| } | ||
| } |
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 well done! 💯
| } else { | ||
| console.log("Sorry you don't have enough money in your account"); | ||
| } | ||
| } |
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.
Great, well done!
| this.counterIndex--; | ||
| this.play(); | ||
| } else { | ||
| this.counterIndex = this.playList.length - 1; |
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 was so close to being perfect, you just missed a this.play() here :)
Really well done though, you did well completing all the optional extras as well!
Your Details
Your Name:
Your City:
Your Slack Name:
Homework Details
Module:
Week: