Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Data Types | Section
JavaScript Essentials for React Native Development

bookData Types

Свайпніть щоб показати меню

In JavaScript, you will work with several basic data types. The most common are string, number, and boolean.

A string is used for text, such as names, messages, or any sequence of characters. For instance, "Alex" is a string that might represent a user's name.

A number is any numeric value, whether it's an integer like 28 or a decimal like 3.14. Numbers are commonly used for things like age, scores, or prices.

A boolean is a type that can only be true or false. Booleans are typically used for values that answer yes/no questions, such as whether a user is logged in.

1234567
const name = "Alex"; // string const age = 25; // number const isActive = true; // boolean console.log(name); console.log(age); console.log(isActive);
copy

JavaScript handles these types flexibly, and you do not need to declare the type when creating a variable. The type is determined by the value you assign. For example, assigning "Alex" to a variable makes it a string, while assigning 28 makes it a number. Booleans are especially useful for controlling logic, like showing or hiding content based on whether a condition is true.

Understanding these data types is essential for managing user data, performing calculations, and making decisions in your code. You will encounter them constantly as you build React Native apps, from displaying user profiles to checking if someone is logged in.

question mark

Which of the following is a boolean value in JavaScript?

Виберіть правильну відповідь

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

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 3

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Секція 1. Розділ 3
some-alt