What's the difference between "if" statement and "elseif" statement?

Is
[lua]
function foo(bar)
if bar == “foo” then print(“arg is foo”) end
if bar == “bar” then print(“arg is bar”) end
[/lua]

different from
[lua]
function foo(bar)
if bar == “foo” then print(“arg is foo”)
elseif bar == “bar” then print(“args is bar”) end
end
[/lua]
?

[lua]function foo(bar)
if(bar == “foo”) then
print(“bar is foo”);
elseif(bar == “bar”) then
print(“bar is bar”);
end
end[/lua]

That would be the same as doing this:

[lua]function foo(bar)
if(bar == “foo”) then
print(“bar is foo”);
end

if(bar ~= "foo" and bar == "bar") then
	print("bar is bar");
end

end[/lua]

If the previous if-statement returns false, it will try the elseif-statement instead.

It will only try the ‘elseif’ if the first ‘if’ statement is false.
If you just use two 'if’s, it will try both of them

That has helped me a lot.

The latter is better for performance in a select-case situation also.