THT is in early Beta. We welcome contributors & feedback.

List

Summary of List access. See methods below.

// An empty List
let colors = [];

// A List with values
let colors = ['red', 'yellow', 'blue'];

// Access list (counting from zero)
colors[0];  //= 'red'
colors[1];  //= 'yellow'

// Access list from end (negative index)
colors[-1];  //= 'blue'

// Set a value directly
colors[1] = 'orange';
//= ['red', 'orange', 'blue']

// Add a value to the end
colors.push('green'); 
//= ['red', 'orange', 'blue', 'green']