Optional, readonly, index signatures and Record
Comes up in: Coding
This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.
What it covers
- optional vs
| undefined(with exactOptionalPropertyTypes) readonlyis shallow and compile-time only- index signatures
Record<K, V>- excess property checks on fresh object literals
Words you will know
What you will practise
- model a dictionary of users
- explain an excess-property error
Interview questions this answers
- What is an excess property check and when does it run?
- Is
readonlyenforced at runtime?