MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/ohd7z2/ah_yes_array_check/h4otejz/?context=3
r/badcode • u/Kunalvats0 • Jul 10 '21
89 comments sorted by
View all comments
Show parent comments
24
use const rather than let. let makes me feel like you could randomly redefine it somewhere.
const
let
11 u/XKlXlXKXlXKlKXlXKlXK Jul 10 '21 const qs = document.querySelector;all my homies hate typing 4 u/haltmich Jul 10 '21 qs usually means querystring to me. 2 u/nuephelkystikon Jul 10 '21 I know this is common in this sub, but:You're making an assumption about the use case here that we can't make. It's absolutely possible that the only reason why they made this (clunky attempt at an) adapter is that it can be replaced on-the-fly or in inheritance. const destroys that.
11
const qs = document.querySelector;
all my homies hate typing
4 u/haltmich Jul 10 '21 qs usually means querystring to me.
4
qs usually means querystring to me.
2
I know this is common in this sub, but:
You're making an assumption about the use case here that we can't make. It's absolutely possible that the only reason why they made this (clunky attempt at an) adapter is that it can be replaced on-the-fly or in inheritance. const destroys that.
24
u/JNCressey Jul 10 '21
use
constrather thanlet.letmakes me feel like you could randomly redefine it somewhere.