The front end One-a-day: JavaScript generates a random string of a specified length January 4, 2024 by Kevin Morgan No Comments const generateString = length= > Array(length).fill(' ').map((v) = > Math.random().toString(36).charAt(2)).join(' '); generateString(6); // rj5qbj Copy the code