Lately, I have seen various questions that use TypeScript in Stack Snippets. They look like this:
There is a problem with my code. Instead of doing x, it does y. Here is my code:
function doSomething(input: string) { // Do something console.log("function");}doSomething("something");
When compiled into JavaScript, no errors are thrown.
Obviously, we can see a few problems here.
- If there are other errors, we might not be able to see them.
- We can't see what the asker is trying to do.
- We can't see the issue that they are having.
What can we do about this?