So I have such function
local function makeIndicator (frame, text)
local group
group = display.newGroup()
--some code here
return group
end
--later I have such code:
local indicatorGroup, indicator1
indicator1= display.newGroup()
indicatorGroup = display.newGroup()
indicator1 = makeIndicator (frame, text)
indicatorGroup:insert (indicator1)
But did I really need to directly declare
indicator1= display.newGroup()
?
Does code without declaration indicator1 as newGroup () work the same way that with declaration?
local indicatorGroup, indicator1
indicatorGroup = display.newGroup()
indicator1 = makeIndicator (frame, text)
indicatorGroup:insert (indicator1)