28/33


#1

Please help. i dont know what im doing wrong.
// Our person constructor
function Person (name, age) {
this.name = name;
this.age = age;
}

// We can make a function which takes persons as arguments
// This one computes the difference in ages between two people
var ageDifference = function(person1, person2) {
return person1.age - person2.age;
}

var alice = new Person("Alice", 30);
var billy = new Person("Billy", 25);

// get the difference in age between alice and billy using our function
var diff = ageDifference(alice, billy) {
return ageDifference(alice, billy) };


#2

Hi @girlswithpens

The problem is in your "diff" variable, you created "ageDifference" function
So you havn't to call back the return in "diff", change and test it :

var diff = ageDifference(alice, billy);
console.log(diff);

Hold on :wink:


#3

thank you:).
couldnt figure out what i did wrong. that worked.