# Constructor

Description:

The `new` operator creates and instantiates an instance of the `MenuItem` object.

Syntax:

    [MenuItem] new MenuItem(String label, Integer id)

Arguments:

- `label`:

  A text string that defines the label for the menu item.

- `id`:

  A unique integer that identifies the menu item.

Return value:

An initialized instance of the `MenuItem` object.

Remarks:

If the arguments are not valid, a JavaScript exception indicating the error type is thrown. A valid argument implies an integer type for id and a string type for label. The string length for the label is truncated to 40 characters if it exceeds that limit.

Menu items on the whole menu tree are unique and identified by their `id`.

For more general information on constructing an options menu, see Using softkeys.

Example code:

See the example code in the description of the `MenuItem.onSelect` property.