Convert Values to Strings in JavaScript with Archetype

Most Recent

What's New in ES2019: Array flat and flatMap, Object.fromEntries

February 05, 2018

ES2019 was recently finalized, which means JavaScript has several new language features to learn. These features are now available in Chrome 73:

Object.assign vs Object Spread in Node.js

January 29, 2018

The Object Rest/Spread Proposal reached stage 4 in 2018, which means it will be included in a future iteration of the ECMAScript spec. It's also been included in Node.js LTS since Node.js 8, so you can safely start using it today.

Convert a String to a Number in JavaScript

January 22, 2019

Converting a string to a number in JavaScript is surprisingly subtle. With NaN, implicit radixes, and numbers vs Numbers, there are a lot of ways to shoot yourself in the foot. In this article, I'll cover the tradeoffs of parseFloat() vs Number() and Number.isNaN() vs isNaN(). I'll also describe how to enforce these rules with eslint.

What's New in Mongoose 5.4: Model Events and Populate Count

January 14, 2019

Mongoose 5.4 was released on December 14, with 13 new features. The overarching theme for 5.4 is making Mongoose SchemaTypes more configurable, but that isn't the whole story. Mongoose 5.4 has several new features that will help you make your apps more robust and concise. In this article, I'll cover the new property and the new count option for virtual populate.

Async Stack Traces in Node.js 12

January 08, 2019

The V8 team announced that they were making some major performance improvements to async/await, including adding a --async-stack-traces option that will make debugging async functions easier. You can try out these new options with a nightly Node.js build. For example, here's the command I ran to download the January 8, 2019 nightly build of Node.js 12:

What's New in Mongoose 5.4: Global SchemaType Configuration

January 03, 2019

Mongoose 5.4 was released on December 14, with 13 new features. The overarching theme for the most important new features is making Mongoose SchemaTypes configurable at the level of individual types. Before digging in to the new features, let's first review what a SchemaType is.