Random Letter Generator

So I’ve been trawling the forums, and maybe I’m blind or just kinda dumb for not knowing how to do this, but how do I generate a random letter? Like, say for each client I want to give them a 4 letter code, how would I make that?

Also, I’m assuming it basically the same to generate a 4 number code instead of letters?


Take a look at this example using Math.random() to generate random string.