MPDon'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?Comment路Article路Sep 29, 2022路19 Practical ES6 Snippets to Solve Common JS Problems 馃殌馃挴