29/33 What's wrong?


My code isn’t working! the message is “TypeError: person2 is undefined”

function Person (name, age) {
    this.name = name;
    this.age = age;
var ageDifference = function(person1, person2) {
    return person1.age - person2.age;
var olderAge = function(person1,person2) {
    if (person1.age > person2.age) {
        return person1.age
    } else {
        return person2.age
var alice = new Person("Alice", 30);
var billy = new Person("Billy", 25);

console.log("A idade da pessoa mais velha é " + olderAge(alice, billy))

Yes, I’m Br =p


Unable to reproduce the error. This code passes on paste in and submit.


Maybe you should do a refresh Browser

++++ reset of session *****************
As you are manipulating with objects
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser


Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom


Thank you guys, I tryed it in another browser, the same code worked.