title: declaring an array type of custom object to a typescript function
body: <p>I hae a model of car imported into current component. Trying to declare an array of cars as a return type to one of the functions. But the compiler would not recognize the car array type. Can you please help ?</p>
  
  <p>carcomponent.ts</p>
  
  <pre><code>     import  { Car } from '../models/car';
  
       export class carComponent implements onInit {
          public car : Car;
  
          carsavailable(): Car[] { //delcaring Car[] is not recognized.
  
          }
  
       }
  </code></pre>
  
  <p>car.ts
  .......</p>
  
  <pre><code>     export class Car {
            name: string;
       }
  </code></pre>
  
  <p>ERROR </p>
  
  <p>The compiler underlines Car[] in red and says 'A function whose delcared type is neither 'void' nor 'any' must return a value.</p>
  
  <p>Do I have to plug in car somewhere or change return type declaration way.</p>