Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Merging Objects and Adding Properties | Advanced Object Manipulation
course content

Conteúdo do Curso

JavaScript Data Structures

Challenge: Merging Objects and Adding PropertiesChallenge: Merging Objects and Adding Properties

Task

Create a script that performs the following tasks:

  • Merge the properties of two objects, personInfo and jobInfo, and store them in a new object named fullInfo.
  • Add a new property to the fullInfo object named isRetired with a value of false.
  • Use a for...in loop to iterate through fullInfo, and log each property and its corresponding value in the format: [property]: [value].

Expected output:

  1. Use the spread operator ({ ... }) to merge properties from personInfo and jobInfo into fullInfo.
  2. After merging, add a new property to fullInfo.
  3. Iterate through fullInfo using a for...in loop to log the properties and their values.

Tudo estava claro?

Seção 3. Capítulo 6
course content

Conteúdo do Curso

JavaScript Data Structures

Challenge: Merging Objects and Adding PropertiesChallenge: Merging Objects and Adding Properties

Task

Create a script that performs the following tasks:

  • Merge the properties of two objects, personInfo and jobInfo, and store them in a new object named fullInfo.
  • Add a new property to the fullInfo object named isRetired with a value of false.
  • Use a for...in loop to iterate through fullInfo, and log each property and its corresponding value in the format: [property]: [value].

Expected output:

  1. Use the spread operator ({ ... }) to merge properties from personInfo and jobInfo into fullInfo.
  2. After merging, add a new property to fullInfo.
  3. Iterate through fullInfo using a for...in loop to log the properties and their values.

Tudo estava claro?

Seção 3. Capítulo 6
some-alt