How not to sort an array in JavaScript | Phil Nash
Array sorting is one of those things you don’t spend too long thinking about, until it stops working for you. Recently I was working with array of items in JavaScript that were not sorting at all p...
Why is JavaScript event delegation better than attaching events to each ele
I typically recommend using event delegation for event listeners instead of attaching them to individual elements. Let’s say wanted to listen to clicks on every element with the .sandwich class. You might do this. var sandwiches = document.querySelectorAll('.sandwich'); sandwiches.forEach(function (sandwich) { sandwich.addEventListener('click', function (event) { console.log(sandwich); }, false); }); But with event delegation, you would listen for all clicks on the document and ignore ones on elements without the .
What's the difference between JavaScript event delegation, bubbling, and ca
Yesterday, I wrote about why event delegation is better than attaching events to specific elements. In response, my buddy Andrew Borstein asked: What’s the difference between event delegation/bubbling/capturing? This is a great question that I get fairly often. The terms are often used interchangeably (sometimes by me, oops!), which can cause some confusion. So let’s clear that up today. tl;dr: event delegation is the technique, bubbling is what the event itself does, and capturing is a way of using event delgation on events that don’t bubble.
The Writable Files API: Simplifying local file access | Web | Google De
The File System Access API enables developers to build powerful web apps that interact with files on the user's local device, like IDEs, photo and video editors, text editors, and more. After a user grants a web app access, this API allows them to read or save changes directly to files and folders on the user's device.
Comprehensive Guide to JavaScript Design Patterns | Toptal
Design patterns are reusable solutions to commonly occurring problems in software design. Let's take a look at how they work and explore some popular JavaScript design patterns.
Now You See Me: How To Defer, Lazy-Load And Act With IntersectionObserver —
Intersection information is needed for many reasons, such as lazy loading of images. But there’s so much more. It’s time to get a better understanding and different perspectives on the Intersection Observer API. Ready?
A JavaScript Promise represents the result of an operation that hasn't been completed yet, but will at some undetermined point in the future. An example of such an operation is a network request. When we fetch data from some source, for example an API, there is no way for us
ES6 In Depth: Arrow functions – Mozilla Hacks – the Web developer blog
ES6 In Depth is a series on new features being added to the JavaScript programming language in the 6th Edition of the ECMAScript standard, ES6 for short. Arrows have been ...
ES6 In Depth: Template strings – Mozilla Hacks – the Web developer blog
ES6 In Depth is a series on new features being added to the JavaScript programming language in the 6th Edition of the ECMAScript standard, ES6 for short. Last week I ...
Welcome to the second part of my series about ECMAScript 6! One of my favorite new web standards of Microsoft Edge, the new browser rendering engine we’re creating at Microsoft, is the...
The Fat Arrow Points This Way: Easy ES6 Goodies for Busy JavaScript Develop
In the beginning, there was LiveScript, begat by Brendan Eich. Tasked by the Netscape skybeards to create a scripting language to grant unto designers and programmers of the early World Wide Web the ability to assemble unto the browser components, yea such as images and plugins, whose code could be written directly unto the page…