?? ??? TypeScript? ?? ??? ?? ? ???? ???? ??? ?? ???? ????? ???? ?? ???? ??? ??? ? ????. ??? ??????? ?? ????? ?? ??? ??? ??? ?? ????? ???????. ? ????? ??? ???? TypeScript ?? ??? ??? ??? ?? ??? ???? ?? ??, ???? ??, ???? ??? ??? ? ?? ???? ?? ????.
?? ???? ??????
TypeScript? ?? ??? ?? ????? ?? ????? ?? ??, ?? ?? ?? ???? ??? ??? ? ????. ???? ??? ???? ?? ?? ??? ???? ????? ???, ?? ?? ?? ??? ??? ??? ??? ??????? ??????.
?? ??? ?? ????
1. ?? ???? ? ?? ??
TypeScript? ??? ???? ??? ?? ?? ?? ??? ? ????. ??? ??? ???? ????? ????? ??? ??? ???? ??? ?? ??????.
const multiply = (a: number, b: number) => a * b; // Return type inferred as number function wrapInArray<T>(value: T) { return [value]; } // Return type inferred as T[]
2. ???? ??? ??
Generics? ???? ?? ????? ???? ??? ??? ??? ??? ? ????. TypeScript? ???? ?? ??? ??? ? ??? ?????.
function identity<T>(arg: T): T { return arg; } const result = identity(42); // T inferred as number
???? ??, ?? ?? ?? ??? ?? ???? ???? ?? ??? ? ?? ???? ? ? ? ?????.
3. ?? ??? ?? ??
?, ?? ?? ??? ?? ??? ?? ?? ??? ?? ??? ?? ??? ?? ?????.
const numbers = [1, 2, 3, 4]; const doubled = numbers.map(num => num * 2); // TypeScript infers num as number
??? ?? ??? ?? ???? ???? ??? ????? ??? ? ????.
function applyToAll<T, R>(items: T[], func: (item: T) => R): R[] { return items.map(func); } const lengths = applyToAll(["hello", "world"], str => str.length); // T inferred as string, R inferred as number
4. ??? ??? ??? ??
??? ??? ?? ??? ???? ???? TypeScript? ??? ??? ???? ??? ??? ? ????.
type IsString<T> = T extends string ? true : false; type Test1 = IsString<string>; // true type Test2 = IsString<number>; // false
?? ??? ??? ???? ?? ??? ??? ??? ? ?? ?????.
5. ???? ?? ??
?? ?? ?? ?? ??? ??? ? TypeScript? ??? ??? ???? ??? ?????.
const person = { name: "Alice", age: 30 }; const { name } = person; // TypeScript infers name as string
6. ??? ??? ??
?? ????????? RxJS, Lodash ?? ??? ?? ?????? ?? ?????? ??? ? ?? ??? ?? ????.
const pipeline = [1, 2, 3].map(num => num * 2).filter(num => num > 3); // Inferred as number[]
? ??? ????? ?? ???? ??? ??? ???? ??? ?? ??? ?????.
function compose<T, R>(f: (arg: T) => R, g: (arg: R) => T) { return (x: T) => g(f(x)); }
?? ??? ??? ??
1. ?? ???? ??
??? TypeScript? ??? ??? ?? ?? ???? ???? ???? ?????.
const multiply = (a: number, b: number) => a * b; // Return type inferred as number function wrapInArray<T>(value: T) { return [value]; } // Return type inferred as T[]
?: ??? ????? ???? ???? ??? ??? ?????.
function identity<T>(arg: T): T { return arg; } const result = identity(42); // T inferred as number
2. ??? ???
??? TypeScript? ??? ???? ?? ???? ???? ??? ??? ? ????.
const numbers = [1, 2, 3, 4]; const doubled = numbers.map(num => num * 2); // TypeScript infers num as number
3. ??? ??
??? ?? ?? ??? ??? ???? ?? ??? ?????.
function applyToAll<T, R>(items: T[], func: (item: T) => R): R[] { return items.map(func); } const lengths = applyToAll(["hello", "world"], str => str.length); // T inferred as string, R inferred as number
??: ??? ??? ??? ??
Feature | Explicit Typing | Inferred Typing |
---|---|---|
Readability | Clear, but verbose | Concise and clean |
Flexibility | Limited to the specified type | Adapts based on context |
Performance | Adds minor overhead during development | Faster development for simple cases |
Error Reduction | Reduces unintended mismatches | Risk of unintended broad or specific types |
??? ??
?? ??
??
??, ?? ?? ??? ?? ?? ?? ??? ???? ??? ??????.
2. ???? ??? ?? ??:
??? ????? ?? ??? ?????.
3. ??? ?? ??:
??? ?? ? ???? ???? ?? ??? ?? ?????.
4. ???? ?? ????:
???? ?? ??? ??? ??? ?? ?? ??? ?????.
?? ??
? ??? TypeScript? ??? ?????? ?? ?? ?????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











JavaScript?? ??? ??? ?? ? ? ?? ??? ???????. 1. ?? ??? ??? ???? ?? ??? ????. ISO ?? ???? ???? ???? ???? ?? ????. 2. ?? ??? ?? ???? ??? ?? ???? ??? ? ??? ? ?? 0?? ????? ?? ??????. 3. ?? ?? ???? ???? ???? ?? ?????? ??? ? ????. 4. Luxon? ?? ???? ???? ?????? ???? ?? ????. ??? ?? ???? ????? ???? ??? ????? ?? ? ????.

TAGGSATTHEBOTTOMOFABLOGPOSTORWEBPAGESERVESPRACTICALPURSEO, USEREXPERIENCE, andDESIGN.1.ITHELPSWITHEOBYOWNSESPORENGENSTOESTOCESKESKERKESKERKERKERDER-RELEVANTTAGSWITHOUTHINGTEMAINCONTENT.2.ITIMPROVESEREXPERKEEPINGTOPONTEFOCUSOFOFOFOCUSOFOFOFOCUCUSONTHEATECLL

??? ?? ? ??? DOM?? ??? ??? ? ?????. ??? ?? ????? ?? ??????, ??? ?? ???? ?? ????????. 1. ??? ??? addeventListener? usecapture ?? ??? true? ???? ?????. 2. ??? ??? ?? ???? usecapture? ???? ????? ?????. 3. ??? ??? ??? ??? ???? ? ??? ? ????. 4. ??? ?? ?? ?? ??? ?? ??? ??????? ??? ???? ?????. 5. ??? ?? ?? ?? ??? ?? ???? ?? ???? ? ??? ? ????. ? ? ??? ???? ???? JavaScript? ??? ??? ??? ????? ???? ???? ??? ??????.

JavaScript ?? ????? ??????? ??? ?? ??? ??? ????? ?? ??? ????. ????? ??? ?????. 1. ?? ?? (CodesPlitting) ??, ?? ??? React.lazy ()? ?? ?? ?? ?? ??? ????? ??? ???? ? ?? ????? ??? ?? ??? ???????. 2. ???? ?? ?? (???)? ????, ES6 ?? ????? ???? "Dead Code"? ???? ?? ? ????? ?? ??? ??? ? ???????. 3. ?? ??? ???? ???? GZIP/BROTLI ? TERSER? JS? ???? ??? ????? ???? ?? ???? ??? ? ? ??????. 4. ??? ???? ???? day.js ? fetch? ?? ?? ?????? ??????.

ES ??? CommonJS? ?? ???? ?? ?? ? ?? ???????. 1. Commonjs? ????????? Node.js ?? ? ??? ?????. 2.ES ??? ???????? ????? ?? ???? ??? ?????. 3. ??, ES ??? ?? ??/????? ???? ??? ??? ?????? CommonJS? Quiew/Module.exports? ???? ???? ???? ?? ? ? ????. 4. Commonjs? Express? ?? ???? Node.js ? ?????? ?? ???? ?? ???? ?? ES ??? ?? ??? ?? ??? ?? ? Node.jsv14? ?????. 5. ?? ? ? ??? ?? ??? ??? ? ????.

Node.js?? HTTP ??? ???? ? ?? ???? ??? ????. 1. ?? ????? ????? ??? ??? ? ?? ????? ?? ?? ? https.get () ??? ?? ??? ??? ? ?? ????? ?? ??? ?????. 2.axios? ??? ???? ? ?? ??????. ??? ??? ??? ??? ??? ??? ???/???, ?? JSON ??, ???? ?? ?????. ??? ?? ??? ????? ?? ????. 3. ?? ??? ??? ??? ??? ???? ???? ??? ??? ???? ?????.

???? ?? ?? ??? JavaScript ??? ????? ?? 4 ?? ??????. 1. ???? ??? ?? ?? ??? ???? ?? ??? Count? ?? ??? ?? ???? ?? ??? FetchData ()? ?? ??? ???? ??? ??? ??? ????? ?? PascalScase? ?? ?????. 2. ???? ? ??? ???? ??? ? ??? ??? ??? Formatuser, SaveUser ? RenderUser? ???? ?? ?? ? ??? ?????. 3. Page? userprofile, Userstats ? React? ?? ???? ???? ? ??? ? ?? ???? ????? ??????. 4. ?? ?? ? ???? ??? ??? ? ???? ??? ??? ??????.

VAR, Let ? Const? ???? ??, ?? ? ?? ?????. 1.var? ?? ??????? ?? ???? ?? ? ??? ?????. 2. let? ?? ?? ????? ?? ?? ???? ?? ? ??? ???? ????. 3. ???? ?? ?? ???? ?? ??????? ? ?? ? ? ??? ?? ??? ?? ?? ??? ? ????. ?? const? ???? ??? ??? ? LET? ???? VAR? ???? ????.
