An objective review. help!


#1

I need help.
What is wrong in my code?

var james = {
job:"programmer",
married: false
};

function Person(job, married) {
this.job = job;
this.married = married;
}

var gabby = new Person("student", true);

     Oops, try again. Make sure that the value of the job property and james 'programmer'

#2

Hi try to refresh the page..


#3

@kintana

++++ 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

and

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

Addendum
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


#4

what is wrong in this code, im getting error like unexpected token in 19th lesson

function Animal(name, numLegs) {
this.name = name;
this.numLegs = numLegs;
}
Animal.prototype.sayName = function() {
console.log("Hi my name is " + this.name);
};

// define a Penguin class
function Penguin(name) {
this.name = name;
this.numLegs = 2;
}
// set its prototype to be a new instance of Animal
Penguin.prototype = new Animal();
var Penguin = {
penguin = "pavitha";
}
penguin.sayName();


#5

Ho You ahoudl create a new penguin like that

var  penguin  = new Penguin("bere typer the name");

Instead of

var Penguin = {
penguin = "pavitha";
}

#6

THis code is correct...try resetting your browser