学习lua-06,异常提示,错误处理
addNum = function(a, b)
assert(type(a) == 'string','a必须是一个字符串')
assert(type(b) == 'string','b必须是一个字符串')
return a..' '..b
end
print(addNum('hello','world!'))
addNum = function(a, b)
assert(type(a) == 'string','a必须是一个字符串')
assert(type(b) == 'string','b必须是一个字符串')
return a..' '..b
end
print(addNum('hello','world!'))