title: Export some properties from the nested object
body: <p>Let's say there is an object that looks like this:</p>
  <pre><code>const object = {
    cars: {
      car1: {
        model: &quot;Car 1 model&quot;,
        name: &quot;Car 1 name&quot;, // &lt;-- export this
      },
      car2: {
        model: &quot;Car 2 model&quot;,
        name: &quot;Car 2 name&quot;, // &lt;-- export this
      },
    },
    bikes: {
      bike1: {
        model: &quot;Bike 1 model&quot;,
        name: &quot;Bike 1 name&quot;, // &lt;-- export this
      },
      bike2: {
        model: &quot;Bike 2 model&quot;,
        name: &quot;Bike 2 name&quot;, // &lt;-- export this
      },
    },
  };
  </code></pre>
  <p>Now I would like to export some of the nested values so that it can be used in various files across the app (<strong>exporting the entire object is not an option</strong>). What we could do is manually create all the required variables and export them like this:</p>
  <pre><code>export const car1Name = object.cars.car1.name;
  export const car2Name = object.cars.car2.name;
  export const bike1Name = object.bikes.bike1.name;
  export const bike2Name = object.bikes.bike2.name;
  </code></pre>
  <p>The problem is that if we add more properties to this object (more cars or bikes), it will be very difficult to maintain as we have to manually create new variable and export them each time something new is added. Could you advice how this can be improved?</p>