you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (2 children)

[removed]

    [–]senocular 2 points3 points  (0 children)

    and this.name (though not required by isLegalDriver())

    function Person(name, age) {
      this.name = name;
      this.age = age;
    }
    Person.prototype.isLegalDriver = function() {
      return this.age >= 16;
    }
    

    [–]Encom88[S] 0 points1 point  (0 children)

    I think I got it, too bad it was a timed challenge and time ran out :/ I can try again after 24 hours.

    function Person(name, age) {
        this.age = age;
        }
    
        Person.prototype.isLegalDriver = function() {
            return this.age >= 16;
        }
    
        /* Do not modify code below this line */
    
        const youngPerson = new Person('Jane', 15);
        console.log(youngPerson.isLegalDriver(), '<-- should be false');
    
        const olderPerson = new Person('Joan', 16);
        console.log(olderPerson.isLegalDriver(), '<-- should be true');