Constructor
new Section(parent, index) → {Section}
Parameters:
| Name | Type | Description |
|---|---|---|
parent | Course | The parent Course this section belongs to |
index | number | The index of this section within the course |
Returns:
- Section object created
- Type:
- Section
Example
const section = new Section(course, 1)Classes
Methods
get() → {object}
Returns section data from the parent Course
Returns:
- Section data
- Type:
- object
Example
section.get() // returns section datagetLesson(index) → {Lesson}
Get a single lesson by index
Parameters:
| Name | Type | Description |
|---|---|---|
index | number | The index of the lesson |
Returns:
- The requested lesson object
- Type:
- Lesson
Example
section.getLesson(0) // returns Lesson objectgetLessons() → {Array.<Lesson>}
Get all lessons belonging to this section
Returns:
- List of lessons
- Type:
- Array.<Lesson>
Example
section.getLessons() // [Lesson1, Lesson2]