---
title: "Discussion on \"19 Practical ES6 Snippets to Solve Common JS Problems 🚀💯\" | Hashnode"
description: "Discussion on \"19 Practical ES6 Snippets to Solve Common JS Problems 🚀💯\". 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 ..."
url: "https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [19 Practical ES6 Snippets to Solve Common JS Problems 🚀💯](https://madza.hashnode.dev/19-practical-es6-snippets-to-solve-common-js-problems?utm_source=hashnode&utm_medium=feed)

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 ...

Sep 15, 2022 · 4 min read · madza.hashnode.dev  
Read the article

-   [#web-development](https://hashnode.com/tag/web-development)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#es6](https://hashnode.com/tag/es6)
-   [#productivity](https://hashnode.com/tag/productivity)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)

## Written by

[Madza](https://hashnode.com/@Madza)

@Madza

  
[View profile](https://hashnode.com/@Madza)

Tools. 🛠 Resources. 📚 All things productivity. 🎯🚀💯

## Responses 6

Markdown supported · ⌘↵ to post

[Mateusz Pigula](https://hashnode.com/@mateuszpigula)

[Sep 29, 2022](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/6335fb60e594fa4ba3b8cea9)

Don't you have a mistake in the 7th snippet? `'#my-element'` is just a string. We should pass there `document.querySelector('#my-element')` or ref, or query for an element inside the `onClickOutside` function, right?

[Adil Rasheed](https://hashnode.com/@AdilShukr)

[Sep 16, 2022](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/63245102dd55cd8b89b1c080)

nice

[Madza](https://hashnode.com/@Madza)

[Sep 16, 2022](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/63245102dd55cd8b89b1c080#reply-632458e1bc15ea8efdf5d19e)

Thanks a lot 👍💯✨

[Matt Lawrence](https://hashnode.com/@MattPorterBridges)

[Sep 16, 2022](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/6323bffcbc15ea8efdf5b962)

As a person that doesn't write JavaScript too often, this is a great resource, thanks!

[Madza](https://hashnode.com/@Madza)

[Sep 16, 2022](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/6323bffcbc15ea8efdf5b962#reply-63240a69dd55cd8b89b1b11b)

Glad you found it useful 👍✨💯

[Csaba Kissi](https://hashnode.com/@Csaba)

[Sep 15, 2022](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/63239908dd55cd8b89b1a5ea)

Some cool tips here mate!

Really useful!

[Madza](https://hashnode.com/@Madza)

[Sep 15, 2022](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/63239908dd55cd8b89b1a5ea#reply-63239b33bc15ea8efdf5b507)

Means a lot, thanks Csaba! 👍✨💯

[Franklin Mayoyo](https://hashnode.com/@mayoyo)

[Sep 15, 2022](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/632372c8dd55cd8b89b1a007)

I must share this!! Continue doing the good work

[Madza](https://hashnode.com/@Madza)

[Sep 15, 2022](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/632372c8dd55cd8b89b1a007#reply-63238f1bdd55cd8b89b1a4a3)

Thank you so much 👍✨💯

[Muzzammil](https://hashnode.com/@humblemuzzu)

[Sep 15, 2022](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/6323545ddd55cd8b89b19aba)

Awesome tips Dude. Thanks for sharing. 😍😍😍🎉🎉🎉🌀🌀🌀

[Madza](https://hashnode.com/@Madza)

[Sep 15, 2022](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/6323545ddd55cd8b89b19aba#reply-63235746dd55cd8b89b19b17)

My pleasure, Muzzammil 👍💯💖
