local Mystery = {} local function PrintWhatType1(X) if type(X) == 'number' then print('number') elseif type(X) == 'table' then print('Table') elseif type(X) == 'string' then print('String') end end local function PrintWhatType2(X) if type(X) == 'number' then print('number') end if type(X) == 'table' then print('table') end if type(X) == 'string' then print('String') end end
What is the difference and what function is more efficient to do?
PrintWhatType1(Mystery) PrintWhatType2(Mystery)