mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-22 08:40:03 +01:00
cbf1f0c86f
Co-authored-by: Marius Andra <marius.andra@gmail.com>
50 lines
1.0 KiB
Plaintext
50 lines
1.0 KiB
Plaintext
print([])
|
|
print([1, 2, 3])
|
|
print([1, '2', 3, ])
|
|
print([1, [2, 3], 4])
|
|
print([1, [2, [3, 4]], 5])
|
|
|
|
let a := [1, 2, 3]
|
|
print(a[1])
|
|
print(a?.[1])
|
|
print(a?.1)
|
|
print(a?.[6])
|
|
print(a?.6)
|
|
print([1, 2, 3][1], )
|
|
print([1, [2, [3, 4], ], 5][1][1][1])
|
|
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])
|
|
print([1, [2, [3, 4]], 5][1][1][1] + 1)
|
|
print([1, [2, [3, 4, ], ], 5, ].1.1.1)
|
|
|
|
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)
|