-
Notifications
You must be signed in to change notification settings - Fork 23
complete task1 variables #12
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
Open
KJ-MU
wants to merge
4
commits into
TheCodePeople:main
Choose a base branch
from
KJ-MU:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,17 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Variables and Operators</title> | ||
| </head> | ||
|
|
||
| <body> | ||
| <script src="./variables.js"></script> | ||
| <!-- <script src="./arthimetic-operators.js"></script> --> | ||
| <!-- <script src="./variables.js"></script> --> | ||
| <script src="./arthimetic-operators.js"></script> | ||
| <!-- <script src="./logical-comaprison-operators.js"></script> --> | ||
| </body> | ||
| </html> | ||
|
|
||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,36 +6,38 @@ TASK 1: | |
| // Have fun! // 😃 | ||
| ********************************************************************************/ | ||
|
|
||
| const exp1 = 10 >= 10; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| const exp1 = 10 >= 10; // TODO: ADD YOUR EVALUATION HERE --> | ||
| let x=10; | ||
| let y=10; | ||
| console.log(x >= y); | ||
| const exp2 = "dog" == "dog"; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log("dog" == "dog"); | ||
| const exp3 = true != false; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log(true != false); | ||
| const exp4 = "10" === 10; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log("10" === 10); | ||
| const exp5 = 5 > 4; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log(5 > 4); | ||
| const exp6 = null == undefined; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log(null == undefined); | ||
| const exp7 = "true" == true; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log("true" == true); | ||
| const exp8 = "false" == false; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log("false" == false); | ||
| const exp9 = NaN === NaN; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log(NaN === NaN); | ||
| const exp10 = !false || false; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log(!false || false); | ||
| const exp11 = false && !false; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log(false && !false); | ||
| const exp12 = "apple" > "pineapple"; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log("apple" > "pineapple"); | ||
| const exp13 = "2" > "12"; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log("2" > "12"); | ||
| const exp14 = undefined == null; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log(undefined == null); | ||
| const exp15 = undefined === null; // TODO: ADD YOUR EVALUATION HERE --> | ||
|
|
||
| console.log(undefined === null); | ||
| /******************************************************************************* | ||
| Task 2: | ||
| In the following tasks, you will practice using logical operators in JavaScript, in addition to some strings methods. | ||
|
|
@@ -47,33 +49,35 @@ const isHappy = false; | |
|
|
||
| // - Check if num is between 10 and 20 (inclusive) using the logical AND operator. Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
|
|
||
| console.log(num >10 && num <20); | ||
| // - Check if num is either less than 5 or greater than 50 using the logical OR operator. Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
|
|
||
| console.log(num < 5 || num > 50); | ||
| // - Check if str is either "apple" or "orange" using the logical OR operator. Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
|
|
||
| console.log(str === "apple" || str === "orange"); | ||
| // - Check if isHappy value is true using the logical NOT operator. Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
|
|
||
| console.log(isHappy != 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 ==10 && num > 10 ); | ||
| // - 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 || num % 5 ); | ||
| // - Check if str contains the letter "e". Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
|
|
||
| console.log(num % 3 || num % 5 ); | ||
| // - Check if str starts with "Hakuna". Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
|
|
||
| console.log(str.includes("e")); | ||
| // - Check if str ends with "a". Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
|
|
||
| console.log(str.endsWith("a")); | ||
| // - Check if num is either negative or odd using the logical OR operator. Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
|
|
||
| divBy2= num % 2; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You forgot to add |
||
| console.log(num < 0 || divBy2 > 0); | ||
| // - Check if the length of str is greater than num or equal to 40 using logical OR operator. Log the result to the console. | ||
| // TODO: ADD YOUR CODE BELOW | ||
| console.log(str.length > num || str.length === 40); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You were supposed to write the evaluation outcome inside a comment to test your knowledge, please do when you can.