At this scope, panel is already declared as parameter of that function so panel will always sure being declared. So if (panel) will make sure panel exists, not null and not undefined.