Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Please read the whole post for context. I am talking about the type system in TypeScript thinking that `l` is a string (which you can find out, for instance, by hovering over the `var` keyword in Visual Studio), when in fact, as you pointed out, it is a number. I assume this is because TypeScript caters to the most common case of indexing a string to obtain a single character (another string, basically).


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: