var please = require('share');
console.log('thank you');

NEW !!!

Monday, 23 November, 2020 UTC

Detect Generator Functions with JavaScript

In the current JavaScript climate of new syntaxes, features, and using loads of external libraries, it seems harder than ever to be sure what your functions are being given or even what the data represents. Of course, we’ve come up with Flow and TypeScript ... more

Friday, 13 November, 2020 UTC

Node isConnected

Every so often I discover a property in JavaScript objects that I didn’t know existed, oftentimes using another trick to accomplish the same functionality. One such property I just learned about was isConnected , a node property that attached to a context ... more

Tuesday, 3 November, 2020 UTC

Limit Promise Concurrency with pool

Methods like Promise.all , Promise.allSettled , Promise.race , and the rest are really excellent for managing multiple Promises, allowing for our apps to embrace async and performance. There are times, however, that limiting the number of concurrent ... more

Wednesday, 28 October, 2020 UTC

How Hacker News Crushed David Walsh Blog

Earlier this month, David’s heartfelt posting about leaving Mozilla made the front page of Hacker News. Traffic increased by 800% to his already-busy website, which slowed and eventually failed under the pressure. Request Metrics monitors performance ... more

Tuesday, 20 October, 2020 UTC

cookieStore: Async Cookie API

One pattern in the JavaScript API world that web development veterans will notice is that we’ve been creating new methods to accomplish what older, grosser APIs once achieved. XMLHttpRequest became the fetch API, some APIs like Battery became async, ... more

Friday, 16 October, 2020 UTC

How to Conditionally Add Attributes to Objects

JavaScript is full of tricks that you don’t know you want until you … want … them. Or maybe just until you see them. One trick I recently realized was conditionally adding attributes to React elements. Of course this trick essentially boils down to conditionally ... more

Monday, 5 October, 2020 UTC

How to Detect When a Sticky Element Gets Pinned

The need for position: sticky was around for years before it was implemented natively, and I can boast that I implemented it with JavaScript and scroll events for ages. Eventually we got position: sticky , and it works well from a visual perspective, ... more

Thursday, 24 September, 2020 UTC

How to Create an Async 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: /* new Function(arg1, ... more

Monday, 21 September, 2020 UTC

Vital Web Performance

I hate slow websites. They are annoying to use and frustrating to work on. But what does it mean to be “slow”? It used to be waiting for document load. Then waiting for page ready. But with so many asynchronous patterns in use today, how do we even define ... more

Monday, 14 September, 2020 UTC

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 ... more

Thursday, 10 September, 2020 UTC

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 ... more

Tuesday, 18 August, 2020 UTC

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. ... more

Monday, 20 July, 2020 UTC

Binding Arguments with Bind

One of my favorite and most essential Function method is bind , a function we added to MooTools when it wasn’t featured in the JavaScript language itself. We often think of using bind to simply bind a method’s call to its host object, but did you know ... more

Monday, 13 July, 2020 UTC

Lazy Load IFRAMEs

We’ve known for a decade that lazy loading resources like JavaScript, CSS, and especially images is a massive performance win for web pages. At first we used tricks and JavaScript to do the lazy loading, but more recently native image lazy loading has ... more

Tuesday, 30 June, 2020 UTC

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. ... more

Thursday, 11 June, 2020 UTC

Kotlin Coroutines and Delay

Whenever I suspect that there’s a timing conflict causing a problem with rendering and directives, I usually opt for a JavaScript setTimeout with a delay. The setTimeout code never makes it to production, but it does help me to understand if my code ... more

Monday, 25 May, 2020 UTC

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 ... more

Thursday, 16 April, 2020 UTC

How to Add Native Keyword Aliases to Babel

Those of you who follow this blog know that not every blog post is an endorsement of a technique but simply a tutorial how to accomplish something. Sometimes the technique described is probably not something you should do. This is one of those blog posts. ... more

Tuesday, 14 April, 2020 UTC

JavaScript Picture-in-Picture API

As a huge fan of media on the web, I’m always excited about enhancements to how we can control our media. Maybe I get excited about simple things like the <video> tag and its associated elements and attributes because media on the web started with ... more

Thursday, 26 March, 2020 UTC

5 Essential git Commands and Utilities

For many of us, git and GitHub play a huge role in our development workflows. Whenever we have a tool that we need to use often, the more fine-tuned we can make that tool, the faster we can get things done. The following are five git commands or helpers ... more

Tuesday, 17 March, 2020 UTC

How to Cancel a Fetch Request

JavaScript promises have always been a major win for the language — they’ve led to a revolution of asynchronous coding that has vastly improved performance on the web. One shortcoming of native promises is that there’s no true way to cancel a fetch …until ... more

Monday, 17 February, 2020 UTC

Lazy Object Initialization

The Firefox DevTools underlying code, which is written with JavaScript and HTML, is a complex application. Due to the complexity and amount of work going on, the DevTools team has done everything they can to load as little as possible. Furthermore the ... more

Tuesday, 11 February, 2020 UTC

Override window.alert

For years the only bit of feedback web developers could get was via alert("{str}") calls. These days we have the web console but, in rare cases, we don’t have a console and alert calls are our only window into a value at a given time. One problem: ... more

Thursday, 6 February, 2020 UTC

Awesome Forward & Reverse Geocoding API: positionstack (Sponsored)

One awesome web functionality we take for granted is geolocation. Based on geolocation data, we can get someone to their destination, provide them suggestions based on their location, and so on. One downside of native geolocation, especially in the browser, ... more

Monday, 20 January, 2020 UTC

IP Geolocation and Threat Intelligence API: ipdata (Sponsored)

An IP address is a simple, numeric piece of information that gets passed to a server, but that IP address can provide a wealth of information with ipdata. With ipdata you can learn user location, language, currency, and much more! Quick Hits ipdata is ... more

Monday, 30 December, 2019 UTC

Goals For 2020

Every new year brings about a sense of optimism that the next 365 can bring about big, positive changes in different phases of life. That’s no exception for me and this blog. I did pretty well with last year’s goals, so I thought I’d push myself again ... more

Monday, 9 December, 2019 UTC

JavaScript ~~

JavaScript is loaded with tiny syntax tricks to accomplish useful effects. For example, explore any codebase to see !! being used to convert a value to a boolean value. Have you seen ~~ before? Let’s have a look at what it does! We can employ ~~ to trigger ... more

Monday, 25 November, 2019 UTC

Image Lazy Loading

Lazy loading images is a practice that’s been popular for a decade and for good reason: images are usually the heaviest downloads on a given webpage and avoiding unloading images that are never seen saves the user bandwidth. There are plugins for lazy ... more

Wednesday, 20 November, 2019 UTC

Getting Started with GraphQL

GraphQL was developed by Facebook in 2012 to power up its mobile apps. Since open-sourcing GraphQL specification in 2015, it gained a lot of popularity and is now used by many development teams, including giants like GitHub, Twitter or Airbnb. Why so? ... more

Wednesday, 6 November, 2019 UTC

JavaScript waitForTime

I write a lot of tests for new features within Firefox DevTools. We have hundreds of “mochitests” which open the browser and perform synthetic actions like clicking, typing, and other user actions. I’ve previously written about waitForever which essentially ... more