JavaScript Tutorials
How to Create an Async Function via “new Function”
One thing I love about JavaScript is that there are many ways to accomplish the same task, one such example being creating functions. There are several patterns for functions; one of the last you see used is the
new Function
method:What if you want...5 Awesome JavaScript Promise Tricks
The Promise API changed the game in JavaScript. We went from abusing
setTimeout
s and settling for synchronous operations to doing everything possible to leverage this new async API. Let's check out a handful of awesome Promise API tricks!Cancel a fetch RequestOne problem we...Logical Assignment Operators
I love JavaScript, it's my favorite programming language, but I love dipping into other languages because they offer a new perspective on coding paradigms. There've been syntax additions to JavaScript that I've seen I found interesting (think
??
in optional chaining) and...Match Emojis with Regular Expressions
When experimenting with unicode property escapes, to identify accented letters in strings, it reminded me of a question I had a few years ago: what is the best way to identify and then replace emojis in a string? I first noticed this practice...
Simple Node.js Proxy
When I wanted to refresh my React.js skills, I quickly moved to create a dashboard of cryptocurrencies, their prices, and and other aspects of digital value. Getting rolling with React.js is a breeze --
create-react-app {name}
and you're off and running. Getting the API...Match Accented Letters with Regular Expressions
Regular expressions are used for a variety of tasks but the one I see most often is input validation. Names, dates, numbers...we tend to use regular expressions for everything, even when we probably shouldn't.The most common syntax for checking alphabetic characters is
A-z
but what if...Promise.allSettled
The Promise object has many useful functions like
all
,resolve
,reject
, andrace
-- stuff we use all the time. One function that many don't know about isPromise.allSettled
, a function that fires when all promises in an array are settled, regardless of whether...Binding Arguments with Bind
One of my favorite and most essential
Function
method isbind
, a function we added to MooTools when it wasn't featured in the JavaScript language itself. We often think of usingbind
to simply bind a method's call to its host object, but did you...JavaScript in SVGs
SVGs are such an amazing tool for creating custom fonts, animations, size-reduced graphics, and more. They're part HTML, part image, and all awesome. Many websites have moved toward SVG instead of JPG, GIF, and PNG due to the flexibility that SVG provides.Whats one example...
Devising the Cloak of Invisibility in JavaScript
Steganography. The art of hiding something right under your nose. For as long as humans have been alive, we’ve been trying to hide things — whether it’s our last slice of pizza or the location of a buried treasure. Do you remember the cool invisible lemon...