title: Initializing an object variable, Error: **'const' declarations must be initialized.**
body: <p>I am trying to initialize an object and assigned a value to that object but I seem to be getting an error when I declare the object.</p>
  <blockquote>
  <p>Error: <strong>'const' declarations must be initialized.</strong></p>
  </blockquote>
  <p>How do I initialize my object?</p>
  <p>Code:</p>
  <pre><code>// Object
  export type DateRange = {
    date: string;
  };
  
  const dateYears = (values: any) =&gt; {
    if (Array.isArray(values.dateYears)) {
  
      const dateRange: DateRange; // error
      values.dateYears.map((item: any) =&gt; {
        dateRange.createdDate = item.value;
      });
    }
  };
  </code></pre>