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

Sulaiman week 9 #1027

Open
wants to merge 2 commits into
base: manchester3
Choose a base branch
from

Conversation

SULAIMAN-100
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.

Excellent work Sulaiman, only a few small comments :)

💯

@@ -61,3 +67,4 @@ console.log(y);
```

What will be the output of this code. Explain your answer in 50 words or less.
<!-- The first output x is logged with its assigned value 9, the second output is the object y => { x: 10} where the key x is accessed and re-assigned in function f2, so as f2 is called the value of x become 10. if y is consoled befor f2 call it will be { x: 9 } -->
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3/3 - perfect! Well done :) 💯

cartContains() {
// Use console.log() to output everything contained in your cart
console.log(`Your shopping cart has ${this.items.length} items: ${this.items}`)
Copy link

@lannem lannem Jul 10, 2020

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, great use of string interpolation on line 31! Well done

}
check_balance(){
console.log(this.amount);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work well done! You could maybe tidy up some of your indentation but apart from that this is great :)

}
play(){
this.index = 0
if(this.music.length > 0 ){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this ever be true if you always set index to be 0 on line 36? :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be true even without giving a value :|

Copy link

@lannem lannem Jul 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry my comment is incorrect! I misread it as you checking if index > 0

if(this.index < 0){this.index = this.music.length - 1}
console.log(`Currently playing: ${this.music[this.index].song} by ${this.music[this.index].singer}`);
}
}
Copy link

@lannem lannem Jul 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job. To simplify your code you could also call your play() function inside your skip() and previous() functions instead of typing out the console log again.

Well done Sulaiman!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@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