Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

Every time I post this, I get so many WTF's in the comments. It's the 'string & {}' trick. Still absolutely essential for getting 'loose autocomplete' in library code.

77,627 Aufrufe • vor 1 Jahr •via X (Twitter)

11 Kommentare

Profilbild von Matt Pocock
Matt Pocockvor 1 Jahr

My course is the bomb, if bombs were 30% off

Profilbild von SecBriefs | Making Cybersecurity Simple
SecBriefs | Making Cybersecurity Simplevor 1 Jahr

🧠Studying for #CompTIA #Security+ but struggling with #Cybersecurity terms?🔍 Cybersecurity Dictionary for Everyone covers everything you need to know and is available on Amazon!🔐 🚀Boost your Security+ prep with it today!💡

Profilbild von Panta
Pantavor 1 Jahr

Super cool! I was curious so I gave it a try - it seems to also work with a String constructor!

Profilbild von Renato Carneiro
Renato Carneirovor 1 Jahr

type DontFuckMyAutoComplete<T extends string> = T | (string & {}); type Model = DontFuckMyAutoComplete <“gpt-4o” | “gemini”>;

Profilbild von Michael Feldstein
Michael Feldsteinvor 1 Jahr

great explanation of why this works

Profilbild von Cory Simmons
Cory Simmonsvor 1 Jahr

I'm not going to learn anything else about Typescript. I'm just going to have AI do it and hope it works. Tired of all this goofy stuff

Profilbild von Tom Duncalf
Tom Duncalfvor 1 Jahr

Haha that's wild. Had no idea this was possible. Nice explanation :)

Profilbild von Akaam Shamerany
Akaam Shameranyvor 1 Jahr

TIL

Profilbild von Ryan Rampersad
Ryan Rampersadvor 1 Jahr

For a second there, I thought that was a Rust syntax trick you were sharing

Profilbild von Light
Lightvor 1 Jahr

Ok nice

Profilbild von shaqcn
shaqcnvor 1 Jahr

WTF

Ähnliche Videos