const random = (min, max) => {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min);
};
const randomItem = (array) => {
return array[Math.floor(Math.random() * array.length)];
};
const randomChar = () => {
return String.fromCharCode(random(65, 90));
}
const randomWord = () => {
return Array.from(Array(random(2, 15)).keys())
.map(() => randomChar())
.join('');
}
const randomChat = () => {
const size = random(1, 15);
for (let i = 0; i < size; i++) {
console.log(randomWord());
}
}
randomChat();
// const char = randomChar();
// const word = randomWord();
// console.log(char);
// console.log(word);
To embed this project on your website, copy the following code and paste it into your website's HTML: