JavaScript

error.cause needs to be logged manually to App Insights

Published on in JavaScript

If you are logging errors to Azure App Insights, and an Error object has a cause property (which too could be an Error object), the cause Error's message and stack properties are not shown in Azure App Insights. But you can log them manually.

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.

Two-way data binding in React

Published on in JavaScript and React

Normally you would use one-way data binding in React apps: parent components own data and pass it to children. You can mimic two-way data binding with a custom hook.

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.