Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.


Get Random Letter From Alphabet with JavaScript

node v14.20.1
version: 2.0.0
function generateAlphabet(capital = false) { return [...Array(26)].map((_, i) => String.fromCharCode(i + (capital ? 65 : 97))); } function getRandomLetter() { const alphabet = generateAlphabet(); return alphabet[Math.floor(Math.random() * alphabet.length)]; } getRandomLetter();

no comments

    sign in to comment