-
Notifications
You must be signed in to change notification settings - Fork 23
task Variables-and-Operators #17
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: main
Are you sure you want to change the base?
Conversation
| const exp6 = null == undefined; // TODO: ADD YOUR EVALUATION HERE -->true | ||
|
|
||
| const exp7 = "true" == true; // TODO: ADD YOUR EVALUATION HERE --> | ||
| const exp7 = "true" == true; // TODO: ADD YOUR EVALUATION HERE -->true |
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.
"true" is a string value and true is a boolean value, they do not equal the same thing, therefore this should evaluate to false
| const exp7 = "true" == true; // TODO: ADD YOUR EVALUATION HERE -->true | ||
|
|
||
| const exp8 = "false" == false; // TODO: ADD YOUR EVALUATION HERE --> | ||
| const exp8 = "false" == false; // TODO: ADD YOUR EVALUATION HERE -->true |
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.
Same goes here, they're two different types, this should be false.
|
|
||
| // - Check if num is even and greater than 10 using the logical AND operator. Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
| console.log(num / 2 == 0 && num > 10); |
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.
Use the mod operator % to check for the remainder instead of the division operator /.
|
|
||
| // - Check if num is divisible by both 3 and 5 using the logical OR operator. Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
| console.log(num / 3 ==0 || num / 5 == 0 ) |
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 division operator / will only return the result, not the remainder, here we're supposed to check if the number is divisible using the mod operator % and then comparing the remainder.
| // - Check if num is either negative or odd using the logical OR operator. Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
|
|
||
| console.log(num /2 == 1 || num < 0) |
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.
Use the mod operator % to check for the remainder instead of the division operator /.
hay my task is done