Skip to content
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

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

Conversation

Devonte202
Copy link

No description provided.

Copy link
Contributor

@ROgbonna1 ROgbonna1 left a 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.
Copy link
Contributor

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'.]
Copy link
Contributor

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

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`.
Copy link
Contributor

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

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

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

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

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

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 = " # # # #";
Copy link
Contributor

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 😉

Copy link
Contributor

@ROgbonna1 ROgbonna1 left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants