Problem... I don't understand why it doesn't work :/ Some help please?


#1

// 3 lignes suffisent pour créer harry_potter
var harry_potter = new Object();
harry_potter.pages = 350;
harry_potter.auteur = "J.K. Rowling";

// Un constructeur customisé pour le Livre
function Livre(pages, auteur) {
this.pages = pages;
this.auteur = auteur;
}
var le_hobbit= new Livre(320,"J.R.R. Tolkien"); //-> here is the problem...:confused:
// Utilisez notre nouveau constructeur pour créer le_hobbit sur une seule ligne


#2

donc ce qui est reellement le probleme.

excusez mon francais


#3

sorry... do you speak english?


#4

Yes you can speak ^^

It's respond me "Wrong. Do you creat the new wit the object "Livre"?"


#5

this is where the problem is. you didint define the function well.
declare the variable first then set it equals to the function

example: var livre = function(pages, auteur),


#6

Thanks, it's work!!!!


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.