JavaScript

Why compose() is right-to-left

Published on in JavaScript

Functions composed together with compose() are called from right to left. It feels unintuitive at first, but it's conventional and kind of makes sense.

JSX vs HTM (Hyperscript Tagged Markup)

Published on in JavaScript and React

Last updated on

HTM provides a transpiler-free alternative to JSX via tagged templates. HTM has some limitations, but can be used in browsers and can be good for smaller projects.

Formatting lists with JavaScript's Intl.ListFormat

Published on in JavaScript

Last updated on

Pass an array of strings and get back a string with the array items separated by commas, except with the last comma replaced with the word "and" or "or." Like "item 1, item 2 and item 3."

"Illegal invocation" errors in JavaScript

Published on in JavaScript

Last updated on

The error is thrown when calling a function whose this keyword isn't referring to the object where it originally did, i.e. when the "context" of the function is lost.