Skip to Content
🎲 欢迎使用 RandBox - 功能强大的 JavaScript 随机数据生成库! 了解详情

letter

// 用法 randBox.letter() randBox.letter({ casing: 'lower' })

返回一个随机字母。

randBox.letter(); => 'p'

默认情况下,它将返回一个随机的小写字母。

注意,原本想将这个选项命名为 case 而不是 casing,但不幸的是这在 JavaScript 中是 switch 语句的保留字

可以指定大写字母

randBox.letter({casing: 'upper'}); => 'A'
最后更新于: