Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Working with Objects | Section
JavaScript Essentials for Backend

bookWorking with Objects

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

Objects are used to store related data together.

Instead of using separate variables, you group information into a single structure.

const user = {
  name: "John",
  age: 25,
  isAdmin: false
};

Each value inside an object is stored as a key-value pair.

You can access data using the key:

1234567
const user = { name: "John", age: 25, isAdmin: false }; console.log(user.name);
copy

You can also update values:

123456789
const user = { name: "John", age: 25, isAdmin: false }; user.name = "Peter" console.log(user.name);
copy

And add new ones:

123456789
const user = { name: "John", age: 25, isAdmin: false }; user.email = "john@example.com"; console.log(JSON.stringify(user));
copy

Objects are widely used in backend development because they represent real data, such as users, products, or orders.

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

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

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

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

Запитати АІ

expand

Запитати АІ

ChatGPT

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

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