Archive: 2021
Inheritance
Inheritance Inheritance is used to create subclasses of a class. The subclass has the properties and methods of the parent class, and also has the exclusive properties and methods of the subclass.
Funtion types
Type of function In addition to the types of function parameters, the function itself (return result) also has a type. Function return result type TS is also inferred. You should not set the type
Types - any, unknown, never
any The any type is the most flexible type specified in TS, and any basically ensures that the TS compiler cannot check anything. But any also takes away all the benefits brought by TS and should b
Types - union, literal, custom/aliases
union union type The writing method is Parameter: Type 1|Type 2|Type 3.... indicates that the parameters can be assigned these types of values. like: 123function combine(input1: string | number, i
Types - Array, Tuple, Enum
TS support for arrays The array type is written as array name: data type in array[], such as hobbies: string[]. Using arrays inside and outside objects is exactly the same. Another way to write it
Types - primitive, object
Core Types Primitive types: number, string, boolean reference types: object, Array TS exclusive typs: Tuple, Enum, any Primitive types are written in TS as parameter: type, such as n1: number.
Typescript Introduction
What is TypeScript TS is a superset of JavaScript. TS takes JS and adds new features and syntax to it. TS cannot be executed directly in JS environment (such as browser, node.js). TS is a programmi
Create new project with Next.js
Packages and plug-ins to be installed in the project next.js engine locking eslint prettier lint-staged vs config testing (jest, cypress) git hooks (husky) conventional commit UI (chakra ui) tailwi