How to Show and Hide Sections

// executionContext is passed as function parameter
var formContext = executionContext.getFormContext();

// Show section within a specified tab
var summaryTab = formContext.ui.tabs.get("Summary"); 
var timelineSection = summaryTab.sections.get("Timeline"); 
timelineSection.setVisible(true);

// Hide section within a specified tab
var summaryTab = formContext.ui.tabs.get("Summary"); 
var timelineSection = summaryTab.sections.get("Timeline"); 
timelineSection.setVisible(false);

Source: formContext.ui.tabs section (Client API reference)