Types, interfaces, generics, utility types, narrowing.
این مجموعه فلشکارت برای توسعهدهندگانی طراحی شده است که میخواهند دانش خود را در زبان TypeScript عمیقتر کنند و برای مصاحبههای شغلی آماده شوند. سوالات روی کارتها کوتاه و دقیق هستند تا بازیابی اطلاعات از حافظه به بهترین شکل انجام شود.
محتوای این دک شامل تایپهای اولیه، اینترفیسها، جنریکها، Utility Types و روشهای Narrowing است. هر کارت به یک مفهوم کلیدی اختصاص دارد تا از پیچیدگی غیرضروری جلوگیری شود.
با استفاده از سیستم تکرار با فاصله (Spaced Repetition) در یادمَد، این کارتها در زمانهای مناسب مرور میشوند تا مطالب به حافظه بلندمدت منتقل شوند. مطالعه روزانه چند کارت برای تسلط بر این مباحث کافی است.
۱۲ کارت اول از ۶۰ — رو و پشت هر کارت
What is a TypeScript type alias?
A type alias creates a new name for a type, which can be primitives, unions, tuples, or complex objects using the type keyword.
What is the primary difference between type aliases and interfaces?
Interfaces create a new type name that is always open for declaration merging, whereas type aliases cannot be merged after creation.
When should you prefer an interface over a type alias?
Use interfaces when defining object shapes that might need to be extended or merged across different modules or declaration files.
When should you prefer a type alias over an interface?
Use type aliases when working with primitives, union types, tuples, or mapped types that cannot be expressed easily with interfaces.
What is declaration merging in TypeScript interfaces?
It is the process where TypeScript automatically combines multiple interface declarations with the same name into a single definition.
What are TypeScript generics?
Generics allow you to create reusable components that can work over a variety of types rather than a single specific type.
What is the syntax for a generic function in TypeScript?
A generic function places type parameters in angle brackets before the parameter list, such as function identity<T>(arg: T): T.
What is a generic constraint?
A generic constraint restricts the types that can be passed to a type parameter using the extends keyword, ensuring specific properties exist.
How do you write a generic constraint requiring a length property?
You use the syntax <T extends { length: number }>, which ensures the passed type implements a length property.
What is the default value of a generic type parameter?
You can provide a default type for a generic parameter using the equals sign, such as <T = string>, which is used if no type is explicitly passed.
What is a TypeScript utility type?
A utility type is a built-in global helper type that facilitates common type transformations.
What does the Partial<T> utility type do?
It constructs a type with all properties of T set to optional, making every property potentially undefined.
این مجموعه برای افراد آشنا با جاوا اسکریپت که میخواهند تایپاسکریپت را یاد بگیرند یا دانش خود را مرور کنند مناسب است.
زمان یادگیری به تلاش شما بستگی دارد، اما با مرور روزانه میتوانید در چند هفته بر تمام نکات مسلط شوید.
بله، بسیاری از نکات کلیدی و سوالات رایج مصاحبههای فرانتاند و بولد در این کارتها گنجانده شده است.
هنوز کسی آزمون نداده؛ اولین نفر باش.
تا ۲۰ سؤال چهارگزینهای از همین دسته، ۳۰ ثانیه برای هر سؤال. خودت را بسنج و رتبهات را میان بقیه ببین. هر نفر فقط یکبار میتواند شرکت کند.
برای شرکت در آزمون وارد شو