Looking at the JavaScript Promise Collection Methods

Let me begin by saying that "Promise Collection Methods" is not something I’ve seen mentioned elsewhere, but is my own way of referring to the various methods of the Promise API that work with multiple promises. They are: Promise.all Promise.allSettled Promise.any Promise.race I’ve used Promise.all many times in the past, and I was aware of the other methods but had not taken the time to actually build a demo of them. This weekend I changed that. After spending a few hours in Sanctuary grinding my Necro character, I put down the controller and picked up the laptop. Here’s what I built. As a note, everything shown here works in modern browsers, but you can check MDN... more →
Posted in: JavaScript

Legacy String Methods for Generating HTML

I’m always really excited to see new methods on JavaScript primitives. These additions are acknowledgement that the language needs to evolve and that we’re doing exciting new things. That being said, I somehow just discovered some legacy String methods that you probably shouldn’t use but have existed forever. Let’s take a look! These legacy string methods take a basic string of text and wrap it in a HTML tag of the same name: "Hello".big() // "<big>Hello</big>" "Hello".blink() // "<blink>Hello</blink>" "Hello".bold() // "<b>Hello</b>" "Hello".italics() // "<i>Hello</i>" "Hello".link("https://davidwalsh.name") // "<a... more →
Posted in: JavaScript