Objects
I have a quick question in this code: var Bradley = new person("Bradley",15,"M"); var Wesley = new person("Wesley",13,"M"); var Liberty = new person("Liberty",4,"F"); function person(name,age,gender){ this.name = name; this.age = age; this.gender = gender; } function Button() //I would have a button in the HTML side to call this function { var N = prompt("enter you name"); switch(N){ case "Bradley": document.write(Bradley); break; case "Wesley": document.write(Wesley); break; case "Liberty": document.write(Liberty); } } It outputs "[object Object]" I was wondering if I had a syntax error or if I had not defined it well enough. Any help you can give would be greatly appreciated to fix this problem :).