-
Notifications
You must be signed in to change notification settings - Fork 11
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
Assignment complete #5
base: master
Are you sure you want to change the base?
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.
Great work here, Devonte! Your communication is so precise and clear. Code is well written. Keep it up!
|
||
console.log(`My favorite singer is ${singer}`); | ||
``` | ||
The above code logs an error because the string variable `singer` is declared outside the scope of where the console can 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.
Good use of the word "scope".
More precise: "it was declared in an inner scope and cannot be accessed in the global scope."
``` | ||
The above code logs: | ||
"Our favorite Marcy Lab family member is Juan Pablo!" [This is logged because, On line 16 the string variable `favorite` is assigned a value of 'Juan Pablo'. ] | ||
"Actually, Maya is my favorite." [This is logged because on line 19 the string variable `favorite` has its value reassigned to 'Maya'.] |
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.
Can we reassign a variable declared with const
?
The above code logs: "100" | ||
"90" | ||
|
||
This is logged because on line 28, the number variable `score` is assigned a value of 90. |
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 sentence!
"90" | ||
|
||
This is logged because on line 28, the number variable `score` is assigned a value of 90. | ||
Then on line 29 a new variable named `newScore` is set equal to the number variable `score`. |
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.
An even better way of saying it:
newScore
was assigned the value that was referenced by score
.
|
||
This is logged because on line 28, the number variable `score` is assigned a value of 90. | ||
Then on line 29 a new variable named `newScore` is set equal to the number variable `score`. | ||
Then on line 30 `score` is reassigned a value of 100. Then on line 31 both variables are console logged, |
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.
yes!
|
||
"ghost evaluates to true", is logged because on line 61 the variable `name` is declared but left undefined. | ||
Thus on line 63 when the OR logical operator compares the variable `name` to the string variable `nickname`, | ||
It short circuits on the first truthy value which will be `nickname`, which in turn gives the variable `someName` a truthy value. |
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.
TEXTbook answer! perfect!
counter += 1; | ||
} | ||
``` | ||
The code on line 89 creates an infinite loop. |
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.
Tell me why in one-two sentences.
@@ -0,0 +1,52 @@ | |||
// Question 1: Looping a Triange | |||
function triangle() { |
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!
} | ||
|
||
// Question 2: FizzBuzz | ||
function fizzBuzz() { |
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 works well!
// Question 3: Chess Board | ||
function chessBoard() { | ||
// write your answer to question three below | ||
let rowOne = " # # # #"; |
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.
Haha clever. My intention was for you to build each row one hashtag at a time but I can't fault you for working smarter not harder 😉
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.
A reminder to get these change requests turned around.
No description provided.