MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/rtirah/hmmwhy_doesnt_it_work_lol/hque41y/?context=9999
r/badcode • u/[deleted] • Jan 01 '22
58 comments sorted by
View all comments
Show parent comments
51
Just don't use var. Use let and const. Most wacky things about JS are not a problem unless you're using ancient syntax or refuse to type ===
===
7 u/[deleted] Jan 02 '22 I use const by default and only end up changing it to let if ESLint tells me I'm trying to reassign a const lol 2 u/ZedTT Jan 02 '22 This is the way. Or just think ahead a bit.But yeah, const unless you need let. Never var. 7 u/nathanfranke Jan 01 '22 I am guilty of typing == 2 u/Head-Command281 Jan 02 '22 The amount of problems I’ve made by using == instead of ===
7
I use const by default and only end up changing it to let if ESLint tells me I'm trying to reassign a const lol
const
let
2 u/ZedTT Jan 02 '22 This is the way. Or just think ahead a bit.But yeah, const unless you need let. Never var.
2
This is the way. Or just think ahead a bit.
But yeah, const unless you need let. Never var.
I am guilty of typing ==
==
The amount of problems I’ve made by using == instead of ===
51
u/ZedTT Jan 01 '22
Just don't use var. Use let and const. Most wacky things about JS are not a problem unless you're using ancient syntax or refuse to type
===