3320 shaares
Therefore I use either of the following two approaches if I need a special value:
- I use
nullas a “switched off” value. (As an aside, this approach is relatively well supported by TypeScript.)- I avoid both
undefinedandnullvia one of the techniques described above. This has the upside of being cleaner and the downside of involving more work.