title: How to define a const array in typescript
body: <p>My Code:</p>
  
  <pre><code>const WEEKDAYS_SHORT: string[] = ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam']
  </code></pre>
  
  <p>the error message comes from TypeScript (3.0) compiler:</p>
  
  <blockquote>
    <p>TS2322: Type 'string[]' is not assignable to type '[string, string, string, string, string, string, string]'.
      Property '0' is missing in type 'string[]'.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/rhZWw.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rhZWw.png" alt="enter image description here"></a></p>
  
  <p>if I change the <code>string[]</code> to <code>ReadonlyArray&lt;string&gt;</code>, then the error message becomes:</p>
  
  <blockquote>
    <p>TS2322: Type 'ReadonlyArray' is not assignable to type '[string, string, string, string, string, string, string]'.
      Property '0' is missing in type 'ReadonlyArray'.</p>
  </blockquote>
  
  <p>my tsconfig.json:</p>
  
  <pre><code>{
    "compilerOptions": {
      "declaration": false,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "lib": ["es6", "dom"],
      "module": "es6",
      "moduleResolution": "node",
      "sourceMap": true,
      "target": "es5",
      "jsx": "react",
      "strict": true
    },
    "exclude": [
      "**/*.spec.ts",
      "node_modules",
      "vendor",
      "public"
    ],
    "compileOnSave": false
  }
  </code></pre>
  
  <p>how can I define a readonly array in TypeScript?</p>