insertFirst

Description

Inserts an element to the front of a list.

Input / Parameter

Output

Example

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

Step

  1. Call the function List.insertFirst inside the Log.write function

  2. Then call the function Conversion.toList inside the List.insertFirst function.

Result

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

See also:

Last updated