📊
Pollz
  • Introduction
  • Quickstart
  • Guides
    • Initializing your app
    • Create a Poll
    • Vote for a Poll
    • Retrieve a Poll
    • Manage Poll Options
    • Listen to update
    • Anonymous Poll
  • Components
    • React
    • React Native
    • Embedded
  • API Reference
    • init()
    • pollOptions()
      • addOption()
      • deleteOption()
      • renameOption()
    • anonymous
      • createAnonymousToken()
      • getAnonymousPoll()
      • voteAnonymously()
    • polls
      • create()
      • get()
      • getAll()
      • vote()
      • rename()
      • deleteOne()
      • listen()
    • pollTypes
      • getAll()
  • Tooling
    • Typescript
    • React
      • usePoll()
      • usePolls()
      • usePollz()
      • usePollTypes()
      • useAnonymousPoll()
Powered by GitBook
On this page
  1. API Reference
  2. pollOptions()

addOption()

addOption(option: string): Promise<PollWithOptions>

Add a new option to the specified poll.

Parameters:

  • option (string): The label for the new option.

Returns:

  • A Promise resolving to the updated poll object (PollWithOptions) after adding the new option.

Example:

const newOption = await pollOptions.addOption('New Option');
console.log('New Poll Option:', newOption);
PreviouspollOptions()NextdeleteOption()

Last updated 1 year ago