Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Compare Variables in JavaScript | Performing Operations in JavaScript
Introduction to JavaScript

bookChallenge: Compare Variables in JavaScript

Task

We have three variables in this task: a = 33, b = 26, and c = "26". We will perform various comparing operations on these variables.

  1. Check if a is equal to b.
  2. Check if b is strictly equal to c.
  3. Determine if a is greater than or equal to c.
  4. Find out if b is less than c.
  5. Check if a is greater than b AND if b is equal to c.
  6. Check if a is equal to b OR if c is less than a.
12345678910
let a = 33; let b = 26; let c = "26"; console.log(a ___ b); // Task 1 console.log(b ___ c); // Task 2 console.log(a ___ c); // Task 3 console.log(b ___ c); // Task 4 console.log(a ___ b && b ___ c); // Task 5 console.log(a ___ b || c ___ a); // Task 6
copy

The output should be:

false
false
true
false
true
true
  1. Use the comparison operators:Β ==,Β ===,Β >=,Β <,Β >.
  2. Use the logical operators:Β ANDΒ (&&) andΒ ORΒ (||).
12345678910
let a = 33; let b = 26; let c = "26"; console.log(a == b); // Task 1 console.log(b === c); // Task 2 console.log(a >= c); // Task 3 console.log(b < c); // Task 4 console.log(a > b && b == c); // Task 5 console.log(a == b || c < a); // Task 6
copy

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 8

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

bookChallenge: Compare Variables in JavaScript

Task

We have three variables in this task: a = 33, b = 26, and c = "26". We will perform various comparing operations on these variables.

  1. Check if a is equal to b.
  2. Check if b is strictly equal to c.
  3. Determine if a is greater than or equal to c.
  4. Find out if b is less than c.
  5. Check if a is greater than b AND if b is equal to c.
  6. Check if a is equal to b OR if c is less than a.
12345678910
let a = 33; let b = 26; let c = "26"; console.log(a ___ b); // Task 1 console.log(b ___ c); // Task 2 console.log(a ___ c); // Task 3 console.log(b ___ c); // Task 4 console.log(a ___ b && b ___ c); // Task 5 console.log(a ___ b || c ___ a); // Task 6
copy

The output should be:

false
false
true
false
true
true
  1. Use the comparison operators:Β ==,Β ===,Β >=,Β <,Β >.
  2. Use the logical operators:Β ANDΒ (&&) andΒ ORΒ (||).
12345678910
let a = 33; let b = 26; let c = "26"; console.log(a == b); // Task 1 console.log(b === c); // Task 2 console.log(a >= c); // Task 3 console.log(b < c); // Task 4 console.log(a > b && b == c); // Task 5 console.log(a == b || c < a); // Task 6
copy

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 8
some-alt