Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.

Altom-week-9 #1032

Open
wants to merge 1 commit into
base: manchester3
Choose a base branch
from

Conversation

AltomHussain
Copy link

Your Details

Your Name:
Your City:
Your Slack Name:

Homework Details

Module:
Week:

Copy link

@lannem lannem left a 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 💯

@@ -13,7 +13,8 @@ Take a look at the following code:
6 console.log(x);
```

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
Copy link

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 :)

@@ -34,6 +35,8 @@ console.log(y)

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()
Copy link

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

@@ -61,3 +64,6 @@ console.log(y);
```

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
Copy link

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}`);
Copy link

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 + ".");
}
}
Copy link

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");
}
}
Copy link

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;
Copy link

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!

@lannem lannem added the reviewed A mentor has reviewed this PR label Jul 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
reviewed A mentor has reviewed this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants