DATE: (data)=>(typeof data)==='date', -> This works with your own typedef but not with typeof :)
I thought about dynamic type checking and it's quite different from the static one -- whereas the static really ensures safety BECAUSE the program won't even exist if there are inconsistencies in types, the dynamic type checking is only useful to provide understandable errors and "fail early" rather than ensure true safety like in the case of the static one. The program will still throw at runtime, but only early and with a human-readable message.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Dam thanks for this article, it's a good read.
DATE: (data)=>(typeof data)==='date',
-> This works with your own typedef but not withtypeof
:)I thought about dynamic type checking and it's quite different from the static one -- whereas the static really ensures safety BECAUSE the program won't even exist if there are inconsistencies in types, the dynamic type checking is only useful to provide understandable errors and "fail early" rather than ensure true safety like in the case of the static one. The program will still throw at runtime, but only early and with a human-readable message.