insertLast
Last updated
Last updated
Inserts an element to the back of a list.
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 |
Description | Output Type |
---|---|
Returns the updated list. | List |
In this example, we will insert a value in the last index of a list and print the result in the console.
Call the function List.insertLast
inside the Log.write
function.
Then call the function Conversion.toList
inside the List.insertLast
function.
The console will print [3,1,5,1]
.
See also:
Functions