total-typescript/beginners-typescript-tutorial

False positive in 07-arrays problem

talves opened this issue · 2 comments

This could be construed as a tuple of type Post, but of course it's an array.

posts: [
{
id: 1,
title: "How I eat so much cheese",
},
],

It might be better to create an array example so it fails if a student set the user interface to [Post] which passes the type checks.

  posts: [
    {
      id: 1,
      title: "How I eat so much cheese",
    },
    {
      id: 2,
      title: "Why I don't eat vegetables",
    },
  ],

Makes sense - go for it!