# Can I use JavaScript in TypeScript?

TypeScript understands JavaScript and uses type inference to give you great tooling without additional code.

Bron: [TypeScript: JavaScript With Syntax For Types.](https://www.typescriptlang.org/)

Onderwerp: [Techniek & internet](https://1001vragen.nl/onderwerp/techniek-en-internet)
Toegevoegd: 2024-04-29
Webpagina: https://1001vragen.nl/vraag/can-i-use-javascript-in-typescript

## Can you put JavaScript in TypeScript?

Yes, you can use TypeScript and JavaScript together in the same project. TypeScript is a superset of JavaScript, which means that any valid JavaScript code is also valid TypeScript code.

Bron: [How To Combine TypeScript And JavaScript Together?](https://www.optimum-web.com/can-you-use-typescript-and-javascript-together-how-to-combine-the-two/#:~:text=Yes%2C%20you%20can%20use%20TypeScript,is%20also%20valid%20TypeScript%20code.)

## Is js compatible with TypeScript?

In addition, the libraries of JavaScript are also compatible with TypeScript. TypeScript is a programming language that supports both dynamic and static typing. It provides classes, visibility scopes, namespaces, inheritance, unions, interfaces, and many other features.

Bron: [TypeScript vs JavaScript: Which One Is Better to Choose?](https://radixweb.com/blog/typescript-vs-javascript#:~:text=In%20addition%2C%20the%20libraries%20of,interfaces%2C%20and%20many%20other%20features.)

## Is it OK to mix TypeScript and JavaScript?

You can build/test/lint/serve your applications and libraries the same way whether you use JavaScript and TypeScript. You can also mix and match them. Regardless whether you use JavaScript or TypeScript, you will have a tsconfig. base.

Bron: [Use JavaScript instead TypeScript - Nx](https://nx.dev/recipes/tips-n-tricks/js-and-ts#:~:text=You%20can%20build%2Ftest%2Flint,base.)

## Can TypeScript do everything JavaScript can?

TypeScript code typically won't perform any differently than JavaScript code, since it's transpiled to JavaScript before running. But in the sense of developer performance: Yes, TypeScript makes it easier to write accurate code more quickly and catch bugs prior to runtime.

Bron: [TypeScript vs. JavaScript: Your Go-to Guide | Toptal®](https://www.toptal.com/typescript/typescript-vs-javascript-guide#:~:text=TypeScript%20code%20typically%20won't,catch%20bugs%20prior%20to%20runtime.)

## Verwante vragen

- [What is TypeScript vs JavaScript?](https://1001vragen.nl/vraag/what-is-typescript-vs-javascript.md)
- [What is the output of 2 +' 2 in JavaScript?](https://1001vragen.nl/vraag/what-is-the-output-of-2-2-in-javascript.md)
- [How hard is TypeScript to learn?](https://1001vragen.nl/vraag/how-hard-is-typescript-to-learn.md)
- [What is a TypeScript example?](https://1001vragen.nl/vraag/what-is-a-typescript-example.md)
- [What is TypeScript used for?](https://1001vragen.nl/vraag/what-is-typescript-used-for.md)
- [Is TypeScript better than JavaScript?](https://1001vragen.nl/vraag/is-typescript-better-than-javascript.md)
- [Hoeveel afspraken staan in het Klimaatakkoord?](https://1001vragen.nl/vraag/hoeveel-afspraken-staan-in-het-klimaatakkoord.md)
- [Wat wordt er in het Klimaatakkoord van Nederland beschreven?](https://1001vragen.nl/vraag/wat-wordt-er-in-het-klimaatakkoord-van-nederland-beschreven.md)
- [Wat is het Klimaatakkoord?](https://1001vragen.nl/vraag/wat-is-het-klimaatakkoord.md)
- [Wat is afgesproken in het klimaatakkoord van Parijs?](https://1001vragen.nl/vraag/wat-is-afgesproken-in-het-klimaatakkoord-van-parijs.md)
