const addLineNum = (string) => { const newText = string .split(" ") .map((line, index) => `${index + 1}. ${line}`) .join(" "); return newText };