A Simple Argument For Typescript
Nick Scialli (he/him)
Posted on April 23, 2020
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?
💖 💪 🙅 🚩
Nick Scialli (he/him)
Posted on April 23, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
javascript Why I Created a Dependency Graph: For Web Developers who Want to Write Efficient Code
November 15, 2024