# insertLast

## Description

Inserts an element to the back of a list.

## Input / Parameter

| Name  | Description                          | Input Type | Default | Options | Required |
| ----- | ------------------------------------ | ---------- | ------- | ------- | -------- |
| data  | The list to be updated.              | List       | -       | -       | Yes      |
| value | The element to be added to the list. | Any        | -       | -       | Yes      |

## Output

| Description               | Output Type |
| ------------------------- | ----------- |
| Returns the updated list. | List        |

## Example

In this example, we will insert a value in the last index of a list and print the result in the console.

### Step

1. Call the function `List.insertLast` inside the `Log.write` function.
2. Then call the function `Conversion.toList` inside the `List.insertLast` function.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-c9139a0f8f5b900efcfc5a58ad83c3205bd5e7ac%2FinsertLast-step-1.png?alt=media)

### Result

1. The console will print `[3,1,5,1]`.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-827673283d88b579553603b63323a912ef16c4ad%2FinsertLast-result-1.png?alt=media)

## Links

### Related Information

See also:

* Functions
  * [Conversion.toList](https://github.com/OrangeKloud/emobiq-documentation/blob/master/document/client/2-5-actions-and-visual-logic/action-reference/react-native/Conversion/toList/toList.md)
