Link to home
Start Free TrialLog in
Avatar of JZeig
JZeigFlag for United States of America

asked on

using prototype to construct a function

Can someone till me what the problem is here?
function FileName(n, d, s) {
      this.name = n;
      this.date = d;
      this.service = s;
}
this.prototype.logInfo = function(){
      console.log(this.name);
};
var m0140415 = new FileName("m0140415", 20140415, "morning");
FileName.logInfo();

// as a side not, I've tried FileName.prototype.loginfo = function()
When I purse in Firefox, it indicate undefined function, and Aptana says I need a  semi; therefore, I added the semi to end of declared function.
ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JZeig

ASKER

I appreciate the additional methods that you posted. Thank you very much.