Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Boolean 4/4 | Data Types and Variables
Introduction to JavaScript (staging)
course content

Зміст курсу

Introduction to JavaScript (staging)

Introduction to JavaScript (staging)

1. Introduction
2. JavaScript syntax
3. Data Types and Variables

Boolean 4/4

Simple Applications of <code class="go3679463865">Boolean()</code> Function

We can pass expressions to the Boolean function to check whether it’s true or false. For example, the following code checks if the number passed to the Boolean() function is completely divisible by 3. It returns true if the value is completely divisible by 3 and false otherwise.

1
console.log(Boolean(21%3 == 0));
copy

But without Boolean() we also get the same result. But Boolean function gives more clarity that Boolean value must return.

1
console.log(21%3 == 0);
copy

Summary

  • Boolean values are either true or false.
  • The first letter of Boolean values (true and false) should be written in uppercase.
  • The Boolean() method is used to evaluate an expression and returns true or false based on results.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 3. Розділ 18
toggle bottom row

Boolean 4/4

Simple Applications of <code class="go3679463865">Boolean()</code> Function

We can pass expressions to the Boolean function to check whether it’s true or false. For example, the following code checks if the number passed to the Boolean() function is completely divisible by 3. It returns true if the value is completely divisible by 3 and false otherwise.

1
console.log(Boolean(21%3 == 0));
copy

But without Boolean() we also get the same result. But Boolean function gives more clarity that Boolean value must return.

1
console.log(21%3 == 0);
copy

Summary

  • Boolean values are either true or false.
  • The first letter of Boolean values (true and false) should be written in uppercase.
  • The Boolean() method is used to evaluate an expression and returns true or false based on results.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 3. Розділ 18
toggle bottom row

Boolean 4/4

Simple Applications of <code class="go3679463865">Boolean()</code> Function

We can pass expressions to the Boolean function to check whether it’s true or false. For example, the following code checks if the number passed to the Boolean() function is completely divisible by 3. It returns true if the value is completely divisible by 3 and false otherwise.

1
console.log(Boolean(21%3 == 0));
copy

But without Boolean() we also get the same result. But Boolean function gives more clarity that Boolean value must return.

1
console.log(21%3 == 0);
copy

Summary

  • Boolean values are either true or false.
  • The first letter of Boolean values (true and false) should be written in uppercase.
  • The Boolean() method is used to evaluate an expression and returns true or false based on results.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Simple Applications of <code class="go3679463865">Boolean()</code> Function

We can pass expressions to the Boolean function to check whether it’s true or false. For example, the following code checks if the number passed to the Boolean() function is completely divisible by 3. It returns true if the value is completely divisible by 3 and false otherwise.

1
console.log(Boolean(21%3 == 0));
copy

But without Boolean() we also get the same result. But Boolean function gives more clarity that Boolean value must return.

1
console.log(21%3 == 0);
copy

Summary

  • Boolean values are either true or false.
  • The first letter of Boolean values (true and false) should be written in uppercase.
  • The Boolean() method is used to evaluate an expression and returns true or false based on results.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 3. Розділ 18
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt