JavaScript tips and tricks💡

A thread🧵

Never declare variables inside a for loop!
https://t.co/0NrXPBEeyL
Copy to clipboard
https://t.co/KZPc9s9M4I
Use "splice" instead of "delete".
https://t.co/4qc9R4Eeoj
Array of unique values.
https://t.co/2F2u3wZiOj
Avoid global variables.
https://t.co/bRAoq3Vx4F
Short circuit conditionals using AND operator.
https://t.co/DHNjQeXXEv
Quick Rounding using OR operator.
https://t.co/rg1TQ37bSQ
"toLocaleString" in JavaScript
https://t.co/n5verHAzjh
Comparing three numbers and how it works!
https://t.co/mgtL3wGSFp
Dynamic property in objects.
https://t.co/LkUWDkxwnJ
NaN🤯
https://t.co/reIYvi7FD4
How to not push node_modules to git!
https://t.co/awaQLKUVZw
Testing in JavaScript.
https://t.co/KUxSZTCHHJ

You May Also Like

I think a plausible explanation is that whatever Corbyn says or does, his critics will denounce - no matter how much hypocrisy it necessitates.


Corbyn opposes the exploitation of foreign sweatshop-workers - Labour MPs complain he's like Nigel

He speaks up in defence of migrants - Labour MPs whinge that he's not listening to the public's very real concerns about immigration:

He's wrong to prioritise Labour Party members over the public:

He's wrong to prioritise the public over Labour Party