/**
* Extract String
*/
type ExtractStringType<T> = T extends `${infer U}` ? U : never;
type StrType1 = ExtractStringType<'ABC'>; // 'ABC'
type StrType2 = ExtractStringType<string>; // never
A function that accepts an argument of an anonymous type where hobbies
is a tuple:
function stringifyPerson(person: {
name: string;
age: number;
hobbies: [string, string]; // tuple
}) {
return `${person.name} is ${person.age} years old and loves ${person.hobbies.join(" and ")}.`;
Таксист зарабатывает 3 тысячи рублей в будни и 5 тысяч в выходные. При этом он тратит на еду 1 тысячу в будни, и 1.5 тысячи в выходные. Каждую третью неделю он тратит 2 тысячи на мойку автомобиля. Сколько понадобится времени, чтобы таксист заработал 1 миллион рулей?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lazy man's guide: multiple GitHub HTTPS accounts on Windows | |
https://dev.to/configcat/lazy-man-s-guide-multiple-github-https-accounts-on-windows-2mad |
NewerOlder