22 lines
433 B
Plaintext
22 lines
433 B
Plaintext
// Quick smoke test for new builtins
|
|
print("--- len ---")
|
|
print(len("hello"))
|
|
print(len([1, 2, 3]))
|
|
print(len({a: 1, b: 2, c: 3}))
|
|
|
|
print("--- typeof ---")
|
|
print(typeof(42))
|
|
print(typeof("hi"))
|
|
print(typeof(true))
|
|
print(typeof(nil))
|
|
print(typeof([1, 2]))
|
|
print(typeof({a: 1}))
|
|
print(typeof(print))
|
|
|
|
print("--- push/pop ---")
|
|
let arr = [1, 2]
|
|
print("push:", push(arr, 3))
|
|
print("arr:", arr)
|
|
print("pop:", pop(arr))
|
|
print("arr:", arr)
|