TGViewer
Programming ∀ Programming ∀ @programming_everyone · 1.35K subscribers
Post #4365 216
Typescriptda bunaqa mazahizm qilsa bo'ladi.

JSchialrga IQtest.

typeT misolidaka agar FromNumber<n> berilsa type level N bo'lishi kerak. Real misol:
FromNumber<1> -> Succ<Zero>

Kegin huddi shuni teskarisi ToNumber<T> . Bu yerda type leveldagi raqamni ham rostmana raqamga o'girish kerak.

O'zi TSdagi literal tiplar evaziga siz masalan bunaqa qilib tip elon qila olasiz let one:1

ToNumber<T> kakraz manashu literal tip qaytarishi kerak. Endi Add<A, B> ni yozsangiz kifoya :)

Bugun ozgina yoshlikni esladim 🥸
More from @programming_everyone
  1. Oct 6, 2026Yana bir prikol narsa aytaymi ? Manashu literal tiplar evaziga typescriptda daje tiplar bi…
  2. Oct 6, 2026Orwell has nothing to do with it.
  3. Oct 6, 2026An illustrated history of the calculator. https://blog.coredump.cx/p/a-brief-history-of-co…
  4. Oct 5, 2026Creative memory management.
  5. Oct 4, 2026What does logic have to do with Java? https://www.youtube.com/watch?v=KYeys_in_Ng
  6. Sep 28, 2026mongodb cooked, ceosi survoribti metaga. va stock choq -16% xozir adashmasm 20%gacha tushi…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →