enum vs const enum in TypeScript: what actually lands in your React bundle
Same source code, different JavaScript after compilation — export enum vs export const enum on NotificationChannel.
Read more →Short notes on code, React patterns and things I find interesting.
Same source code, different JavaScript after compilation — export enum vs export const enum on NotificationChannel.
Read more →JavaScript's .length lies about emoji and accented characters. Intl.Segmenter splits text into real graphemes — here's how to use it.
Read more →When memoization hurts more than it helps — a quick look at unnecessary useMemo in React.
Read more →Split text into two-character chunks. When the length is odd, pad the final pair with an underscore.
Read more →Convert a number from 1 to 3999 into Roman notation — digit by digit, with subtractive rules for 4 and 9.
Read more →Check whether a number equals the sum of its digits each raised to the power of the digit count — e.g. 153 = 1³ + 5³ + 3³.
Read more →Replace each character with '(' if it appears once, or ')' if more than once — case insensitive.
Read more →Swap even and odd index characters N times — plus a decrypt function that reverses it.
Read more →Generate all unique permutations of a non-empty string — recursion with set deduplication.
Read more →