Lesson.prototype.indexTitleHtml = function() {
    return `
    <div>
        <i class="fa ${this.statusIconName}"></i>
        <i class="fa ${this.typeIconName}"></i>
        <a href="/lessons/${this.id}">${this.title}</a>
    </div>`
}

Lesson.unitHtml = function(lessons) {
    return lessons.reduce((html, props) => {
      const lesson = new Lesson(props);
      return html += lesson.indexTitleHtml()}
    , '')
    // let html = '';
    // for (let index in lessons) {
    //     const lesson = new Lesson(lessons[index]);
    //     html += lesson.indexTitleHtml()
    // }
    // return html
}

Lesson.getUnitIndex = function(ev) {
    unitId = $(ev.currentTarget).data().unitId;
    $unitIndexContainer = $(`#unit-${unitId}`)

    if ($unitIndexContainer.children().length === 0) {
        $.ajax({
            url: `/lessons/units/${unitId}`,
            dataType: 'json',
            method: 'GET'
        })
        .success((data) => {
          console.log(data);
            const html = Lesson.unitHtml(data);
            $unitIndexContainer.empty().append(html);
        })
        .fail(() => {
            errorMessage(`Oops! Failed to load '${url}'.`);
        });
    }
}

$(function() {
    if ($('body').hasClass("lessons index")) {
        $('.unit a').on('click', Lesson.getUnitIndex)
    }
})
@@ -303,20 +303,25 @@
 ((html, 
-prop
+attribute
 s) =%3E %7B%0A
@@ -356,12 +356,17 @@
 son(
-prop
+attribute
 s);%0A
@@ -425,191 +425,8 @@
 '')%0A
-    // let html = '';%0A    // for (let index in lessons) %7B%0A    //     const lesson = new Lesson(lessons%5Bindex%5D);%0A    //     html += lesson.indexTitleHtml()%0A    // %7D%0A    // return html%0A
 %7D%0A%0AL
@@ -774,37 +774,8 @@
 %3E %7B%0A
-          console.log(data);%0A
     

rename props to attributes to be consistent