My favorite argument for typescript is that, in many cases, it doesn't even let you do the wrong thing.
Let me show you what I mean.
In this example, I forgot the name of the complete
property of the todo object. Typescript won't even compile my code and my editor shows linting errors:
type Todo = {
name: string;
complete: boolean;
}
const newTodo: Todo = {
name: "Walk the dog",
finished: false
}
And the linting errors showing my type is wrong:
Any javascripters intrigued?