TypeScript learning notes
TypeScript notes 1. Construction of development environment 1. Download and install node js 2. Installing typescript globally using npm npm i -g typescript 3. Create ts file for writing 4. Use tsc to compile ts files tsc xxx.ts 2. Basic type ·The type of variable in ts can be specified by type UTF-8...
Posted by Allenport on Sun, 02 Jan 2022 07:24:58 +1030
typescript function / class / interface
Interface type Object type interface Suppose I want to get a set of data from the back end and render it to the page, we can define it as follows: interface List { id:number; name:string; } interface Result { data:List[] } function render (result:Result) { result.data.forEach((value) => { consoUTF-8...
Posted by Beavis2084 on Wed, 05 Jan 2022 08:25:38 +1030
TypeScript(TS) syntax collation
TypeScript(TS) 1. Introduction: TypeScript is a superset of JavaScript, including ES567, etc. (with a powerful type system) New type system and complete object-oriented syntax Projects written in TS are more robust and easier to expand and maintain. The popular point is specification 2.TypeScriUTF-8...
Posted by cassius on Fri, 11 Feb 2022 07:42:32 +1030
Typescript express novice tutorial S9 relationship between postgresql tables
Too long to see In the previous use of MongoDB, if there is a relationship between the data of two collections, in order to inform the database of the relationship between these data, it needs to be carried out when creating the schema. Therefore, this Schmea is the prototype of the table. postUTF-8...
Posted by Tyen on Wed, 09 Mar 2022 02:13:20 +1030
The difference between any, void, unknown and never in TypeScript
The article comes from a personal blog https://knightyun.github.io/2021/04/03/js-ts-type-compare , reprint, please state TypeScript expands the basic types and language features of JavaScript. In order to cover the scenario of type checking, it derives some additional types. The applicable situUTF-8...
Posted by rcorlew on Fri, 25 Mar 2022 11:42:47 +1030
TypeScript Array (array) declaration and simple use
Table of contents TypeScript Array (array) 1. Array declaration: The array object uses a separate variable name to store a series of values. 2.Array object: You can use the Array object to create an array. 3: Array deconstruction: Array elements can be assigned to variables. 4. Array iteration:UTF-8...
Posted by blintas on Thu, 22 Dec 2022 04:52:08 +1030