Skip to content

@technobuddha > library > String > Parts of Speech

Function: possessive()

ts
function possessive(input: string): string;

Defined in: possessive.ts:18

Determine the possessive form of a word

Parameters

ParameterTypeDescription
inputstringThe word

Returns

string

The possessive form of the word

Example

typescript
possessive('Calvin');  // "Calvin's"
possessive('Hobbes');  // "Hobbes'"
possessive('BUGS');    // "BUGS'"
possessive('ELMER');   // "ELMER'S"