-
Notifications
You must be signed in to change notification settings - Fork 10
Week6 Homework Submission #2
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
base: Hamza-Koc
Are you sure you want to change the base?
Conversation
epq
left a comment
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.
I left a few comments. Overall, good work 👍
|
|
||
| //3.Declare a variable age and initialize it with an integer, using these exact steps: | ||
| let x; | ||
| console.log('the value of age will be: 30'); |
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.
After you ran your program, do you understand why x isn't 30 when you first declared it on line 12?
| //4.Declare a variable name and assign a string to it. | ||
|
|
||
| let y ='butterfly'; | ||
| console.log('the value of my string will be:bird'); |
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.
Maybe you made a typo, but the value of y isn't bird here.
| let roundedNumber=Math.round(number); | ||
| console.log(number); // prints 7 | ||
|
|
||
| if(roundedNumber < number){ |
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 work here, but make sure you declare your variable result with the let keyword, i.e. let result;. Otherwise, it'll automatically become a global variable (https://www.w3schools.com/js/js_scope.asp)
| console.log(myString.length); | ||
|
|
||
|
|
||
| //8.If x equals 7, and the only other statement is x = x % 3, what would be the new value of x? |
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 job with the examples here!
| console.log(counter + 2); | ||
|
|
||
|
|
||
| counter=+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.
counter = +2 actually assigns the value of the counter to 2. The third method would be to write this out twice:
counter++;
counter++;
| //6.Arrays | ||
|
|
||
| let colors=[]; | ||
| console.log('the value of my array is: blue, yellow, green, black'); |
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.
Did you forget to add some colors to your array?
No description provided.