2024-06-12 11:46:11 +02:00
|
|
|
print([])
|
|
|
|
print([1, 2, 3])
|
2024-06-20 16:05:15 +02:00
|
|
|
print([1, '2', 3, ])
|
2024-06-12 11:46:11 +02:00
|
|
|
print([1, [2, 3], 4])
|
|
|
|
print([1, [2, [3, 4]], 5])
|
2024-06-07 11:37:53 +02:00
|
|
|
|
2024-06-12 11:46:11 +02:00
|
|
|
let a := [1, 2, 3]
|
2024-07-09 13:02:00 +02:00
|
|
|
print(a[1])
|
|
|
|
print(a?.[1])
|
|
|
|
print(a?.1)
|
|
|
|
print(a?.[6])
|
|
|
|
print(a?.6)
|
2024-06-20 16:05:15 +02:00
|
|
|
print([1, 2, 3][1], )
|
|
|
|
print([1, [2, [3, 4], ], 5][1][1][1])
|
2024-07-09 13:02:00 +02:00
|
|
|
print([1, [2, [3, 4], ], 5]?.1?.1?.1)
|
|
|
|
print([1, [2, [3, 4], ], 5]?.[1]?.[1]?.[1])
|
|
|
|
print([1, [2, [3, 4], ], 5]?.6?.3?.1)
|
|
|
|
print([1, [2, [3, 4], ], 5]?.[6]?.[3]?.[1])
|
2024-06-12 11:46:11 +02:00
|
|
|
print([1, [2, [3, 4]], 5][1][1][1] + 1)
|
2024-06-20 16:05:15 +02:00
|
|
|
print([1, [2, [3, 4, ], ], 5, ].1.1.1)
|
2024-07-16 15:55:05 +02:00
|
|
|
|
|
|
|
print('------')
|
|
|
|
|
|
|
|
print(arrayPushBack([1,2,3], 4))
|
|
|
|
print(arrayPushFront([1,2,3], 0))
|
|
|
|
print(arrayPopBack([1,2,3]))
|
|
|
|
print(arrayPopFront([1,2,3]))
|
|
|
|
print(arraySort([3,2,1]))
|
|
|
|
print(arrayReverse([1,2,3]))
|
|
|
|
print(arrayReverseSort([3,2,1]))
|
|
|
|
print(arrayStringConcat([1,2,3], ','))
|
|
|
|
|
|
|
|
print('-----')
|
|
|
|
let arr := [1,2,3,4] // we don't modify arr
|
|
|
|
print(arr)
|
|
|
|
arrayPushBack(arr, 5)
|
|
|
|
print(arr)
|
|
|
|
arrayPushFront(arr, 0)
|
|
|
|
print(arr)
|
|
|
|
arrayPopBack(arr)
|
|
|
|
print(arr)
|
|
|
|
arrayPopFront(arr)
|
|
|
|
print(arr)
|
|
|
|
arraySort(arr)
|
|
|
|
print(arr)
|
|
|
|
arrayReverse(arr)
|
|
|
|
print(arr)
|
|
|
|
arrayReverseSort(arr)
|
|
|
|
print(arr)
|