---
title: "Comment by Mateusz Pigula on \"19 Practical ES6 Snippets to Solve Common JS Problems 🚀💯\" | Hashnode"
description: "Don&#39;t you have a mistake in the 7th snippet? &#39;#my-element&#39; is just a string. We should pass there document.querySelector(&#39;#my-element&#39;) or r"
url: "https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b/comment/6335fb60e594fa4ba3b8cea9"
---

[Discussion](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b)

Comment [19 Practical ES6 Snippets to Solve Common JS Problems 🚀💯](https://hashnode.com/posts/19-practical-es6-snippets-to-solve-common-js-problems/632346bfdd55cd8b89b1986b)

[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?
