Table.foreach and for key, value in table do - what's the difference

is there a difference between table.foreach and for key, value in table do

or even

table.foreachi and for index, value in table do

local t = {
    hi = "hello";
    lol = "haha";
}

table.foreach(t, function(k, v)
    print(k, v)
end)

for k, v in t do
    print(k, v)
end

That is just an old deprecated function.