Skip to Content
๐ŸŽฒ Welcome to RandBox - Powerful JavaScript Random Data Generation Library! Learn More

prefix

// usage randBox.prefix() randBox.prefix({ full: true })

Generate a random name prefix

randBox.prefix(); => 'Mrs.'

By default, returns the shorter version.

Optionally get back the full version.

randBox.prefix({ full: true }); => 'Mister'

Optionally specify a gender. Valid options are male, female, or all (the default).

randBox.prefix({ gender: "male" }); => 'Mr.' randBox.prefix({ gender: "female" }); => 'Miss'

To maintain legacy support, this also responds to randBox.name_prefix().

Last updated on: