Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
nsonha
· 2y ago · 0 comments
do you need readonly with never?
Comments
[–]
samtheprogram
2y ago
Yes, otherwise consumers could try reading the property (that doesn’t exist).
[–]
nsonha
OP
2y ago
how would
read
only fixes consumers
read
ing the property?
[–]
whilenot-dev
2y ago
it doesn't.
never
prevents reading and
readonly
prevents (over)writing.
GP just focused on the
never
-part of your question.
[–]
nsonha
OP
2y ago
never
means nothing can be assigned to it, so in that sense it's already
readonly