JavaScript Tutorials
Optional Chaining
For all of the improvements that the JavaScript language has added over the past few years, like the spread operator, default argument values, and arrow functions, there are still a few features I'd love to see implemented. One such feature is optional chaining.
JavaScript Proxy with Storage
The JavaScript Proxy API provides a wealth of "magic" within JavaScript, allowing you to use any object as sort of an alias that allows a wall of validation, formatting, and error throwing. Did you know that you could also employ the Proxy API as...
Detect Cryptocurrency by Wallet Address
I’ve always been a massive advocate of cryptocurrency. I love the technology, the ease of use, and the freedom that cryptocurrencies bring to the world. Despite my love of crypto, I know that adoption will take a long time and that the state of crypto...
Set Video Playback Speed with JavaScript
I love that media has moved from custom plugins (Flash…gross) to basic HTML
<video>
and<audio>
elements. Treating these media sources as just another element allows us to use CSS filters to adjust display, for example. The less we need to do with...How to Debug Remote Browsers
It's super frustrating when bugs pop up only in a remote browser. Something about that user, that device, or that environment is different, but I don't know what! And of course, I can't recreate it on my local development machine. The team at TrackJS...
How to Detect Text in Images
Images are a great way to communicate without text but oftentimes images are used/abused to spread text within social media and advertisements. Text in images also presents an accessibility issue. The truth is that it's important, for any number of reasons, to be able to detect...
Detect if Element is a Web Component
I've advocated for web components since before they became a spec, mostly inspired by the Dojo Toolkit's dijit framework. Empowering first class JavaScript widgets, as opposed to a mess of DIVs and templates, always made the most sense. Now that web components exist, and awesome...
IP Geolocation API
Detecting geolocation information from your user provides you a massive advantage: improved conversion, better segmenting and analytics, and providing more relevant content. There are numerous paid services which will provide geolocation info but they're oftentimes too costly or short of valuable information. I was super impressed...
Resize Observer
Creating websites that are reactive and responsive used to be considered advanced but responsiveness is a necessity for successful websites and apps. We've added media queries,
matchMedia
, and a host of other APIs to help developers make responsiveness easier and now we get a new...Recursive Array.flat
There was much talk about
Array.prototype.flat
during its early stages, starting with the name alone. Many developers preferred the nameflatten
but the spec differed from MooTools' implementation. MooTools would recursively flatten an array but the new, officialflat
implementation defaults one level of flattening,.The current...