forked from Mirror/wren
- Rename IO.write -> IO.print. - Make IO.write not print a newline. - Support \u Unicode escapes in strings.
13 lines
349 B
Plaintext
13 lines
349 B
Plaintext
// Returns elements.
|
|
var list = ["a", "b", "c", "d"]
|
|
IO.print(list[0]) // expect: a
|
|
IO.print(list[1]) // expect: b
|
|
IO.print(list[2]) // expect: c
|
|
IO.print(list[3]) // expect: d
|
|
|
|
// Allows indexing backwards from the end.
|
|
IO.print(list[-4]) // expect: a
|
|
IO.print(list[-3]) // expect: b
|
|
IO.print(list[-2]) // expect: c
|
|
IO.print(list[-1]) // expect: d
|