4 ms·
Afaik let in JavaScript also has a sizable penalty too, if not quite as bad as const. Var on and on.
by jauntywundrkind 4mo ago
Afaik let in JavaScript also has a sizable penalty too, if not quite as bad as const. Var on and on.
- crabmusket 4mo agoLet and const have a "temporal dead zone" before initialisation that distinguishes them from var, which is just undefined: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#temporal_dead_zone_tdz https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... Runtime TDZ checks can be performance issues: https://vincentrolfs.dev/blog/ts-var https://vincentrolfs.dev/blog/ts-var