Over the moon - prints undefined


why are does it print out undefined?

// create a constructor for the StaffMember class

var StaffMember = function(name, discountPercent){
    this.name = name;
    this.discountPercent = discountPercent;


var sally = new StaffMember("Sally",5);
var bob = new StaffMember("Bob",10);

//Create a StaffMember for yourself called me
var me = new StaffMember("Me", 20);



The above is printing the return value of the StaffMember() function. Since there is no return value, JS responds by stepping in with, undefined.



Thanks for responding. I will play around with this.


my code not defined . why?


Hi you forgot to put the argument name and discountPercent to the object staffMember