-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
George Lemmon #195
base: main
Are you sure you want to change the base?
George Lemmon #195
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.
@GALemmon - Hi George, I just had a chance to go over your pre-work and you are officially Turing ready
! I added some questions/comments to a few sections for areas to work on or adjustments to make as you continue to practice before starting Mod 1. Keep up the hard work moving forward and let me know if you have any questions.
} else if (i % num2 === 0) { | ||
console.log('buzz'); | ||
// These lines state that if none of the other condiditons are true, the console should print the value of i. |
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.
Nice work on the annotations.
// Print the last archEnemy to the console | ||
|
||
console.log('last archenemy', archEnemies[2]); |
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.
How would you print the last archEnemy
if you didn't know the length of the array?
// Write some code to add a new archEnemy to the archEnemies array | ||
|
||
archEnemies = [...archEnemies, ' the cat box']; |
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.
Very nice!
// - badExcuse should be a string a hero would say if they are too afraid of the dangerLevel | ||
|
||
// Your function should include an if/else statement that meets the following criteria | ||
// - Danger levels that are above 50 are too scary for your hero. Any danger level that is above 50 should result in printing the badExcuse to the console | ||
// - Anything dangerLevel that is between 10 and 50 should result in printing the saveTheDay string to the console | ||
// - If the dangerLevel is below 10, it means it is not worth your time and should result in printing the string "Meh. Hard pass." to the console. | ||
|
||
function assessSituation(dangerLevel) { |
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.
The instructions say that the function assessSituation
should accept three arguments - dangerLevel
, saveTheDay
, and badExcuse
. Why have the latter two been declared as variables inside the function?
assessSituation(50); | ||
assessSituation(40); | ||
assessSituation(5); | ||
|
||
//Test Cases | ||
var announcement = 'Never fear, the Courageous Curly Bracket is here!'; | ||
var excuse = 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back.'; | ||
// assessSituation(99, announcement, excuse) > Should print - 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back.' |
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.
Lines 94 - 96 are calling the function assessSituation
passing in three arguments.
@@ -74,11 +148,50 @@ var excuse = 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back. | |||
|
|||
// - Create 2 instances of your SuperHero class | |||
|
|||
class SuperHero { | |||
constructor(name, superpower, age, archNemesis, powerLevel, energyLevel) { |
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.
Because archNemesis
, powerLevel
, and energyLevel
are to be assigned to static values, they don't need to be passed into the constructor function.
} | ||
|
||
gainPower(addedPower) { | ||
this.powerLevel = this.powerLevel + addedPower |
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.
Nice 💯
}; | ||
|
||
var hero1 = new SuperHero('Light Guy', 'Gently Floating', '56'); | ||
var hero2 = new SuperHero('Snake Girl', 'Cleaning Slow Drains', '24'); |
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.
You can see here, the SuperHero
class is instantiated with only three arguments.
this.toppings = toppings; | ||
} | ||
|
||
changeProtein() { |
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.
The method changeProtein
should accept a parameter (see instructions) and assign that parameter to the this.protein
variable.
// ADD CODE | ||
addTopping(newTopping) { | ||
var newToppings = [...this.toppings, newTopping] | ||
this.toppings = newToppings |
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.
Nice job here ⚡
Here is the completed Mod 1 prework.