Lua 数据类型-变量
num = 100  --number
str = 'hello'  --string
b = true  --boolean
tab = {1,3,5,7,9} --table
first = tab[1]  --number
local loc = 2  --局部变量

print(type(num))  --number
print(type(str))  --string
print(type(b))  --boolean
print(type(tab))  --table
print(type(first))	--number

Lua变量的数据类型都是动态确定的

没有整数类型,number称为小数类型

table类型其实就是数组类型

没有加local的变量都是全局变量


首页 我的博客
粤ICP备17103704号