Don’t use functions as callbacks unless they’re designed for it

Solid advice by Jake: Here’s an old pattern that seems to be making a comeback: import { toReadableNumber } from ‘some-library’; const readableNumbers = someNumbers.map(toReadableNumber); Here’s the problem: // We think of: const readableNumbers = someNumbers.map(toReadableNumber); // …as being like: const readableNumbers = someNumbers.map((n) => toReadableNumber(n)); // …but it’s more like: const readableNumbers = someNumbers.map((item, …

Destructuring arrays in PHP: Practical examples

Being more focussed on JavaScript nowadays, I kinda forgot that it’s possible to destructure arrays in PHP ever since the release of PHP 7.1. Frank de Jonge provides us with some practical examples such as this simple one: // JavaScript let options = {enabled: true, compression: ‘gzip’}; let { enabled, compression } = options; console.log(enabled); …

V8 internals for JavaScript developers: Arrays

This presentation demonstrates how learning just a little bit about JavaScript engine internals can help you improve the run-time performance of your JavaScript code — not just in V8 specifically, but across all JavaScript engines! A written version is also available.