const colors = ['red', 'green', 'blue', 'yellow', 'purple']; const randomColor = faker.random.array_element(colors); console.log(randomColor); // Output: blue (randomly selected)
const words = ['apple', 'banana', 'cherry', 'orange', 'pear']; const randomWord = faker.random.array_element(words); console.log(randomWord); // Output: orange (randomly selected)
const numbers = [1, 2, 3, 4, 5]; const randomNumber = faker.random.array_element(numbers); console.log(randomNumber); // Output: 2 (randomly selected)The `faker.random.array_element()` function is part of the Faker.js library.