Section

Creates a new Section object

Constructor

new Section(parent, index) → {Section}

Parameters:
NameTypeDescription
parentCourseThe parent Course this section belongs to
indexnumberThe index of this section within the course
Returns:
- Section object created
Type: 
Section
Example
const section = new Section(course, 1)

Classes

Section

Methods

get() → {object}

Returns section data from the parent Course
Returns:
- Section data
Type: 
object
Example
section.get() // returns section data

getLesson(index) → {Lesson}

Get a single lesson by index
Parameters:
NameTypeDescription
indexnumberThe index of the lesson
Returns:
- The requested lesson object
Type: 
Lesson
Example
section.getLesson(0) // returns Lesson object

getLessons() → {Array.<Lesson>}

Get all lessons belonging to this section
Returns:
- List of lessons
Type: 
Array.<Lesson>
Example
section.getLessons() // [Lesson1, Lesson2]