CharacterName

CharacterName

new CharacterName()

Description:
  • Represents a character's name with various attributes.

Source:
Properties:
Name Type Attributes Description
given String

The given (first) name of the character.

nickname String <optional>

The nickname or alternative name of the character.

family String <optional>

The family (last) name of the character.

heritage String <optional>

The heritage of the character (anglo or latino)

gender String <optional>

The gender of the character.

born String <optional>

The maiden name of the character.

Example
const name = new CharacterName({
  given: 'Jane',
  family: 'Doe',
  nickname: 'Janey',
  heritage: 'anglo',
  gender: 'female',
  born: 'Smith'
});
name.toString();
=> "Janey"
name.toLastNameString();
=> "Doe (born Smith)"