Re:A small guide for naming stuff in front-end code
by emptysea on Thursday January 13, 2022 @12:04AM
(#29917069)
TypeScript will produce an error when using a function inside and if stmt without calling it:
produces:
https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABMA...
[ Parent
| on HN ]
Re:A small guide for naming stuff in front-end code
by not2b on Thursday January 13, 2022 @05:00PM
(#29927507)
It seems that a linter tool would catch this even if TypeScript isn't used. In any case even if "get" is used, a coder might accidentally write
if (getBooleanProperty) { ... }
omitting the parens.