Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Creating an Object | Objects Fundamentals
course content

Зміст курсу

JavaScript Data Structures

Challenge: Creating an ObjectChallenge: Creating an Object

Task

Create a JavaScript object called informationCard representing basic personal information. Inside this object, include a nested object with contact details, such as a home address and phone number. The object should have the following structure:

Information card (outer object):

  • First Name (e.g., "Alice");
  • Last Name (e.g., "Smith");
  • Age (e.g., 25);
  • Contact Details (nested object).

Contact Details (nested object):

  • Home Address (e.g., "123 Main St, Apt 4B");
  • Phone Number (e.g., "555-123-4567").

Note

In this challenge, nothing will be output in the console after clicking 'Run Code' as we don't console.log() anything.

  1. Use an object literal to define the outer object.
  2. Inside the outer object, create a property called contactDetails and assign it a nested object.
  3. Inside the nested object, add the necessary properties.
  4. You can fill in any data.

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

Секція 2. Розділ 4
course content

Зміст курсу

JavaScript Data Structures

Challenge: Creating an ObjectChallenge: Creating an Object

Task

Create a JavaScript object called informationCard representing basic personal information. Inside this object, include a nested object with contact details, such as a home address and phone number. The object should have the following structure:

Information card (outer object):

  • First Name (e.g., "Alice");
  • Last Name (e.g., "Smith");
  • Age (e.g., 25);
  • Contact Details (nested object).

Contact Details (nested object):

  • Home Address (e.g., "123 Main St, Apt 4B");
  • Phone Number (e.g., "555-123-4567").

Note

In this challenge, nothing will be output in the console after clicking 'Run Code' as we don't console.log() anything.

  1. Use an object literal to define the outer object.
  2. Inside the outer object, create a property called contactDetails and assign it a nested object.
  3. Inside the nested object, add the necessary properties.
  4. You can fill in any data.

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

Секція 2. Розділ 4
some-alt