Step: Object Construction. Select fields.

Object Construction. Select fields.

Like JSON, {} is for constructing objects, e.g {"a": 42, "b": 17}.

To construct new object with subset of fields. Just use {make, model} syntax similar to JavaScript's shorthand property names.

Now let's use this knowledge to construct a new object only with first and last name.

Input:
{
  "firstName": "Charles",
  "lastName": "Doe",
  "location": {
    "city": "San Francisco",
    "postal-code": "94103"
  }
}
Expected:
{
  "firstName": "Charles",
  "lastName": "Doe"
}