This repository was archived by the owner on Oct 26, 2020. It is now read-only.
Open
Conversation
lannem
reviewed
Jul 10, 2020
|
|
||
| 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.
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.
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 |
|
|
||
| cartContains() { | ||
| // Use console.log() to output everything contained in your cart | ||
| console.log(`Your shopping cart has ${this.length} items: ${this.item}`); |
| greeting() { | ||
| console.log("Hi! I'm " + this.name + "."); | ||
| } | ||
| } |
| } else { | ||
| console.log("Sorry you don't have enough money in your account"); | ||
| } | ||
| } |
| this.counterIndex--; | ||
| this.play(); | ||
| } else { | ||
| this.counterIndex = this.playList.length - 1; |
There was a problem hiding this comment.
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!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Your Details
Your Name:
Your City:
Your Slack Name:
Homework Details
Module:
Week: