Created
April 23, 2025 09:24
-
-
Save cemerson/8ac48969b80baaa6f0e258e099dd3f43 to your computer and use it in GitHub Desktop.
JavaScript: remove all but last 15 <article> nodes from DOM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const articles = [...document.querySelectorAll('article')]; articles.slice(0, -15).forEach(el => el.remove()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment