Add new built-in function type() that returns the name of the type of
the given value as a string. Includes test case.
This commit is contained in:
8
src/test/res/type.lua
Normal file
8
src/test/res/type.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
print(type(5))
|
||||
print(type(3.14))
|
||||
print(type("hello"))
|
||||
print(type(function() return 1 end))
|
||||
print(type({}))
|
||||
print(type(nil))
|
||||
print(type(2 < 5))
|
||||
print(type(pairs({})))
|
||||
BIN
src/test/res/type.luac
Normal file
BIN
src/test/res/type.luac
Normal file
Binary file not shown.
Reference in New Issue
Block a user