>>108197090
const capitalizeIndex = (
/** @type {string} */ str,
/** @type {number} */ targetIndex,
) =>
str
.split("")
.map((char, charIndex) =>
charIndex === targetIndex ? char.toUpperCase() : char,
)
.join("");
const isWhiteSpace = (/** @type {string} */ str) => !str.trim();
const wave = (/** @type {string} */ str) =>
Array.from(str).flatMap((char, index) =>
isWhiteSpace(char) ? [] : capitalizeIndex(str, index),
);