Skip to content

task Variables-and-Operators#17

Open
mohamedali0122 wants to merge 2 commits into
TheCodePeople:mainfrom
mohamedali0122:main
Open

task Variables-and-Operators#17
mohamedali0122 wants to merge 2 commits into
TheCodePeople:mainfrom
mohamedali0122:main

Conversation

@mohamedali0122
Copy link
Copy Markdown

hay my task is done

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
Copy link
Copy Markdown

@AlhassanAli01 AlhassanAli01 Feb 9, 2024

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
Copy link
Copy Markdown

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.

Comment thread logical-comaprison-operators.js

// - 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);
Copy link
Copy Markdown

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 )
Copy link
Copy Markdown

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)
Copy link
Copy Markdown

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 /.

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