13/30 Help!


#1

keep getting the "make sure you created a Person called me" and "age is undefined" idk what I am doing wrong

function Person (me) {
this.name = name;
this.age = age;
}

var printPersonName = function (p) {
console.log(p.name);
};

var adrien = new Person("Adrien Jones", 36);
printPersonName(Adrien);


#2

@blaksun3679 take a look at your code below corrected with comments on why it was not working before

//the person constructor must have two
//arguments thats is the name and age
//you provided an argument that is not used
//in anyway
function Person(name, age) {
    this.name = name;
    this.age = age;
}

var printPersonName = function (p) {
    console.log(p.name);
};

var adrien = new Person("Adrien Jones", 36);

//you stored a person object in a varibale
//called 'adrien' not 'Adrien'
printPersonName(adrien);

#3

I still keep getting "age undefined" sighhhhhhh.


#4

can you put a screen shot of the code here


#5

var me = new Person("Eric P.", 16);
printPersonName(me);

This should work, it did for me.


#6

thanks guys! I see what I did wrong with the names being different like rydan said. I understood that part. What was getting me was the printPerson. I was putting printPerson(Adrien) instead of printPerson(me), I see that now.

thanks for the help!