We use cookies on this site to enhance your user experience

Boolean: Code Sample 2

Boolean: Code Sample 2

-- These values are all "truthy"
if true then
	print("true")
end
if 1 then
	print("1")
end
if "text" then
	print('"text"')
end
if {1, 2, 3} then
	print("{1, 2, 3}")
end
if workspace then
	print("workspace")
end

-- So are these, despite what you might expect
if 0 then
	print("0")
end
if "" then
	print('""')
end
if {} then
	print("{}")
end

-- But these values are not
if false then
	print("false")
end
if nil then
	print("nil")
end