Generation

generate functionThu, 17 Nov 2022

Generate random sentence from lists

function getRandomInt(max) { return Math.floor(Math.random() * Math.floor(max)); } function generateName(adjectives, animals) { return adjectives[getRandomInt(adjectives.length)] + " " + animals[getRandomInt(animals.length)]; } generateName(["skinny", "fat", "smelly", "generous"], ["cat", "dog", "fish", "horse"])

Javascript
Generate More

Want to kickstart your project?Use the new AI Studio to create your code