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

> Would any of C#, C++, or TypeScript catch that

C# would have a compile error with that map and parseInt definition because it can't coerce the types.



parseInt and the map callback signature both declare the second argument as integers:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

The thing which would actually catch this would be the mismatch in the number of arguments (modulo someone declaring that third argument as optional) or breaking compatibility to change one of them not to be a basic integer.




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: