How are HTMLElement.innerText and Node.textContent different?
While these two properties are very similar, there are some key differences that you should be aware of.
30 seconds of code provides a curated collection of short code snippets for all your development needs. Our collection spans many topics, ranging from simple coding problems to theoretical concepts and development techniques.
While these two properties are very similar, there are some key differences that you should be aware of.
Learn how to parse or serialize a cookie with JavaScript, quickly and effectively.
Implement the K-nearest neighbors algorithm in JavaScript to classify a data point relative to a labelled data set.
Create the most whimsical link hover effect with a squiggle animation.
Display a menu overlay when the user hovers over an image.
Learn how you can create a card that displays additional content on hover.
Learn of all the different ways to set the value of a selected input in React with this quick guide.
Learn how to easily convert between the various color formats, using JavaScript and a few simple formulas.
Parse a text file and return an array of lines, synchronously or asynchronously, using Node.js.
Learn how to use JavaScript ES6 generators to create a range generator that produces a sequence of numbers.
Find the most frequently occurring element in a JavaScript array of primitives or objects.
Use simple DOM queries to find all the images contained within an element.
Learn how mutability works in JavaScript, its applications to objects and how you can properly freeze them to make them constant.
Level up your JavaScript logging with these console.log()
tips and tricks.
Staggered animations can be used to create a more dynamic user experience. Get creative with your lists!
Don't fall victim to bad advice! Learn to identify "senior juniorism", and develop critical thinking to make better coding decisions.
A binary search tree is a hierarchical data structure of ordered nodes with at most two children each.
Boolean traps can cause readability and maintainability issues in your code. Learn what they are, how to spot and fix them in this article.
Ever wanted to dynamically load an external script in React? Here's a trick to help you out.
Do you need to lock the body scroll when a modal is open? Perhaps this custom hook can help.
Ever wanted to show or hide one or more elements in HTML, using JavaScript? Turns out it's very easy to do so.
The Node.js test module is a new testing tool that's still in its early stages. Learn more about it in this short introduction.
Learn everything you need to know about higher-order functions with this short guide and level up your programming skills.
Ever had elements that horizontally overflow the viewport? This JavaScript function can help you identify them.