The desired length of the generated alphabetic string
A string containing only lowercase letters of the specified length
RandomGenerator.alphabets(5); // e.g. "kxqpw"
RandomGenerator.alphabets(3); // e.g. "mzr"
RandomGenerator.alphabets(10); // e.g. "qwertasdfg"
// Generate random CSS class names
const className = `test-${RandomGenerator.alphabets(6)}`;
// Create random variable names for testing
const varName = RandomGenerator.alphabets(8);
contracts/common.md#principled-implementation Each requested character maps a Math.random draw to one of 26 lowercase letters. Repeats are possible, and distribution inherits Math.random rather than guaranteeing exact uniformity.
Generates a random string containing only lowercase alphabetical characters.
Creates a string of specified length using only characters a-z. Each character is independently randomly selected, so the same character may appear multiple times. Useful for generating random identifiers, test names, or placeholder text.
Processing cost: Constructing L characters costs O(L) time and intermediate/result space.