Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | dev:typescript [2023/05/01 17:30] (current) – [Hello World] Henrik Yllemo | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <button type=" | ||
+ | ====== TypeScript ====== | ||
+ | |||
+ | <data programminglanguage> | ||
+ | Full Name: TypeScript | ||
+ | Short Name: TS | ||
+ | Description: | ||
+ | Company: Microsoft | ||
+ | Web: Yes | ||
+ | Mobile: Yes | ||
+ | Enterprise: No | ||
+ | Embedded : No | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <panel title=' | ||
+ | TypeScript is a strongly typed superset of JavaScript that adds optional static typing and other features to the language. It was developed by Microsoft and released in 2012 as an open-source language. | ||
+ | </ | ||
+ | Type safety: TypeScript' | ||
+ | Improved code organization: | ||
+ | Improved editor support: TypeScript offers better editor support than JavaScript, including code completion, refactoring, | ||
+ | Compatibility with existing JavaScript code: TypeScript can be used with existing JavaScript code and libraries, making it easy to adopt gradually. | ||
+ | Improved tooling: TypeScript has a robust set of tools, including the TypeScript compiler, which can convert TypeScript code into JavaScript, and many popular editors and IDEs support TypeScript. | ||
+ | </ | ||
+ | Some of the key features of TypeScript include: | ||
+ | * Static typing: TypeScript supports static typing, which helps catch errors early in the development process. | ||
+ | * Interfaces: TypeScript supports interfaces, which allow you to define contracts between different parts of your code. | ||
+ | * Classes: TypeScript supports classes, which allow you to define reusable objects with properties and methods. | ||
+ | * Generics: TypeScript supports generics, which allow you to create reusable code that works with different types. | ||
+ | * Decorators: TypeScript supports decorators, which allow you to add metadata to your code that can be used at runtime. | ||
+ | </ | ||
+ | Yes, TypeScript can be used in production applications. Many large-scale applications, | ||
+ | </ | ||
+ | Yes, TypeScript can be used with React. In fact, many developers prefer using TypeScript with React because of its improved type checking and editor support. | ||
+ | </ | ||
+ | To get started with TypeScript, you'll need to install the TypeScript compiler and configure your development environment to use it. You can then start writing TypeScript code and compiling it to JavaScript using the compiler. Many popular editors and IDEs, including Visual Studio Code and WebStorm, have built-in support for TypeScript. | ||
+ | </ | ||
+ | Yes, TypeScript supports asynchronous programming using features like async/await and Promises. These features allow you to write asynchronous code that is more readable and maintainable than traditional callback-based code. | ||
+ | </ | ||
+ | < | ||
+ | TypeScript is a superset of JavaScript and shares many features with it, but it also includes additional features like static typing, interfaces, and classes. TypeScript is often compared to languages like Java and C#, which also support strong typing and object-oriented programming. | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | {{wp> | ||
+ | <callout type="" | ||
+ | * https:// | ||
+ | |||
+ | TypeScript is an open source programming language developed by Microsoft and first released in 2012. It is designed to add type safety to JavaScript while conforming as closely as possible to the syntax and semantics of the ECMAScript standard. | ||
+ | |||
+ | It is a syntactical superset of the JavaScript programming language; all valid JavaScript source code is also valid TypeScript source code, but not vice-versa. TypeScript compiles (or transpiles) to JavaScript, meaning that it can be utilized to target any JavaScript environment. It can be used to develop JavaScript for both client-side and server-side applications. | ||
+ | </ | ||
+ | <callout type="" | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | |||
+ | <WRAP column right>< | ||
+ | </ | ||
+ | < | ||
+ | ===== Hello World ===== | ||
+ | |||
+ | <sxh javascript> | ||
+ | var message = 'Hello World'; | ||
+ | console.log(message); | ||
+ | |||
+ | </ | ||
+ | <WRAP column right>< | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | See also: [[dev: | ||
+ | |||
+ | {{tag> | ||
+ | |||
+ | |||
+ | === ## ToDo ## === | ||
+ | * FIXME | ||
+ | * Static typing | ||
+ | * Interfaces | ||
+ | * Classes | ||
+ | * Inheritance | ||
+ | * Polymorphism | ||
+ | * Enums | ||
+ | * Generics | ||
+ | * Union and intersection types | ||
+ | * Type guards | ||
+ | * Decorators | ||
+ | * Modules | ||
+ | * Namespaces | ||
+ | * Error handling | ||
+ | * Promises | ||
+ | * Async/await | ||
+ | * Arrow functions | ||
+ | * Template literals | ||
+ | * Type compatibility | ||
+ | * Type aliases | ||
+ | * Declaration files | ||
+ | * Web development (e.g., React, Angular, Vue) | ||
+ | * Node.js | ||
+ | * Deno runtime | ||
+ | |||