addLesson(lesson) {
        if (!lesson.group) console.assert(false, "lessons must have group property");
        if (!lesson.title) console.assert(false, "lesson must have title property");
        if (!lesson.url) console.assert(false, "lesson must have url property");
        if (!lesson.pages) console.assert(false, "lesson must have pages property");
        /* Preferred: Use if/else for top-level logic
        
        lesson.group || console.assert(false, "lessons must have group property");
        lesson.title || console.assert(false, "lesson must have title property");
        lesson.url || console.assert(false, "lesson must have url property");
        lesson.pages || console.assert(false, "lesson must have pages property");*/

        if (this.warehouse.lessonMetaData.lessonTitles.some((x) => x === lesson.title)) return this;
        else {
            this.warehouse.lessonMetaData.lessonTitles.push(lesson.title);
            this.warehouse.lessonMetaData.lessons[lesson.title] = lesson;
        };

        const found = this.warehouse.navItems.find((x) => {
            const test = x.group === lesson.group;
            return test;
        });

        if (found) found.lessons.push(lesson);
        else {
            this.warehouse.navItems.push({group: lesson.group, lessons: []});
            this.warehouse.navItems[this.warehouse.navItems.length - 1].lessons.push(lesson);
        };


        this.warehouse.navItems.forEach((lessonGroup) => {
            if (lessonGroup.group != 'Introduction') {
                lessonGroup.lessons.sort((a,  b) => {
                    console.log('vals', a, a.difficulty, b ,b.difficulty)
                    return a.difficulty - b.difficulty
                })
            }
        })

        return this;
    }
/**
     * addLesson  ::  {group: string, title: string, url: string} -> store object
     * 
     * Method checks the warehouse.navItem array for elements with the property group
     * 
     *      if an element's contains the same group property, push the lesson to 
     *          that element's lesson propery array
     * 
     *      if it no element contains the same group property, create a new element
     *          with a group property that matches the lesson.group property, then 
     *          create a lessons property with an array containing the new lesson 
     *          object as its only element
     * 
     * returns store object to allow method chaining
     */


Method checks the warehouse.navItem array for elements with the property group

if an element's contains the same group property, push the lesson to
that element's lesson propery array

if it no element contains the same group property, create a new element
with a group property that matches the lesson.group property, then
create a lessons property with an array containing the new lesson
object as its only element

returns store object to allow method chaining
Method checks the warehouse . navItem array for elements with the property group if an element ' s contains the same group property push the lesson to that element ' s lesson propery array if it no element contains the same group property create a new element with a group property that matches the lesson . group property then create a lessons property with an array containing the new lesson object as its only element returns store object to allow method chaining
addLesson(lesson) {
        if (!lesson.group) console.assert(false, "lessons must have group property");
        if (!lesson.title) console.assert(false, "lesson must have title property");
        if (!lesson.url) console.assert(false, "lesson must have url property");
        if (!lesson.pages) console.assert(false, "lesson must have pages property");
        if (this.warehouse.lessonMetaData.lessonTitles.some((x) => x === lesson.title)) return this;
        else {
            this.warehouse.lessonMetaData.lessonTitles.push(lesson.title);
            this.warehouse.lessonMetaData.lessons[lesson.title] = lesson;
        };
        const found = this.warehouse.navItems.find((x) => {
            const test = x.group === lesson.group;
            return test;
        });
        if (found) found.lessons.push(lesson);
        else {
            this.warehouse.navItems.push({group: lesson.group, lessons: []});
            this.warehouse.navItems[this.warehouse.navItems.length - 1].lessons.push(lesson);
        };
        this.warehouse.navItems.forEach((lessonGroup) => {
            if (lessonGroup.group != 'Introduction') {
                lessonGroup.lessons.sort((a,  b) => {
                    console.log('vals', a, a.difficulty, b ,b.difficulty)
                    return a.difficulty - b.difficulty
                })
            }
        })
        return this;
    }
addLesson ( lesson ) { if ( ! lesson . group ) console . assert ( false , "lessons must have group property" ) ; if ( ! lesson . title ) console . assert ( false , "lesson must have title property" ) ; if ( ! lesson . url ) console . assert ( false , "lesson must have url property" ) ; if ( ! lesson . pages ) console . assert ( false , "lesson must have pages property" ) ; if ( this . warehouse . lessonMetaData . lessonTitles . some ( ( x ) => x === lesson . title ) ) return this ; else { this . warehouse . lessonMetaData . lessonTitles . push ( lesson . title ) ; this . warehouse . lessonMetaData . lessons [ lesson . title ] = lesson ; } ; const found = this . warehouse . navItems . find ( ( x ) => { const test = x . group === lesson . group ; return test ; } ) ; if ( found ) found . lessons . push ( lesson ) ; else { this . warehouse . navItems . push ( { group : lesson . group , lessons : [ ] } ) ; this . warehouse . navItems [ this . warehouse . navItems . length - 1 ] . lessons . push ( lesson ) ; } ; this . warehouse . navItems . forEach ( ( lessonGroup ) => { if ( lessonGroup . group != 'Introduction' ) { lessonGroup . lessons . sort ( ( a , b ) => { console . log ( 'vals' , a , a . difficulty , b , b . difficulty ) return a . difficulty - b . difficulty } ) } } ) return this ; }
addLesson  ::  {group: string, title: string, url: string} -> store object
addLesson :: { group : string title : string url : string } - > store object
/* Preferred: Use if/else for top-level logic
        
        lesson.group || console.assert(false, "lessons must have group property");
        lesson.title || console.assert(false, "lesson must have title property");
        lesson.url || console.assert(false, "lesson must have url property");
        lesson.pages || console.assert(false, "lesson must have pages property");*/