Automatic text linking in React
Ever wondered how to detect links in plaintext strings and make them clickable? A little ingenuity combined with React can get you there.
30 seconds of code contains a curated collection of code articles covering a wide range of development needs. The collection spans many topics, ranging from simple coding problems to theoretical concepts and development techniques.
Ever wondered how to detect links in plaintext strings and make them clickable? A little ingenuity combined with React can get you there.
A quick reference for the window.location
object.
Hoisting comes up a lot during JavaScript interviews. It's a concept that may require some getting used to, so read our guide to learn more.
s the sum of the powers of all the numbers from start
to end
(both inclusive).
Master JavaScript array element removal with these simple techniques.
Learn how to remove accents from a string in JavaScript, quickly and efficiently.
Generate the powerset of a given array of numbers or other primitive values.
Learn how to find the contiguous subarray with the largest sum within an array of numbers in JavaScript.
Find the element with the greatest length
in a JavaScript array.
Implement the Levenshtein distance algorithm in JavaScript to calculate the difference between two strings.
Array destructuring can be leveraged in many different ways. Here's one of them.
Find the distance from a given element to the top of the document with this simple JavaScript function.
Learn how to detect whether a page is being viewed on a mobile device or a desktop.
Learn the basics of the destructuring assignment syntax in JavaScript ES6 and improve your code with this easy guide.
Create a generator that generates all dates in a given range.
A queue is a linear data structure which follows a first in, first out (FIFO) order of operations.
Learn how to capitalize the first letter of a string in JavaScript using array destructuring and String.prototype.toUpperCase()
.
Find the head or tail of a JavaScript array without mutating it.
Do you want to see a list of all local branches sorted by date? Here's a simple command to help you with that.
Looking for the merge commit where the changes from a given commit were merged into a branch? Here's how you can find it.
Create an animated underline effect when the user hovers over some text.
Eliminate the need for non-semantic markup to clear floats.
In React components, you might need to conditionally apply a className
. Learn how to handle empty values correctly using this handy tip.
Did you know that the delay of setTimeout()
and setInterval()
is merely a suggestion?