In our developer workflow, we often encounter challenging problems that might require just a few lines of code to be solved. In this article, I attempted to compile useful snippets that may assist you when working with URLs, DOM, events, dates, user ...

Markdown supported Β· ββ΅ to post
As a person that doesn't write JavaScript too often, this is a great resource, thanks!
Mateusz Pigula
Don't you have a mistake in the 7th snippet?
'#my-element'is just a string. We should pass theredocument.querySelector('#my-element')or ref, or query for an element inside theonClickOutsidefunction, right?