Re: [nodejs] Objects in node.js

2013-03-11 Thread Rick Waldron
Bind the constructor's |this| object... MongoClient.connect('...', function() {...}.bind(this)); On Monday, March 11, 2013, Martin Cooper wrote: > > > On Sun, Mar 10, 2013 at 3:10 PM, Venkatesh U > > > wrote: > >> Hi, >> I have defined the following class in a .js file and I am trying to >>

Re: [nodejs] Objects in node.js

2013-03-11 Thread Martin Cooper
On Sun, Mar 10, 2013 at 3:10 PM, Venkatesh U wrote: > Hi, > I have defined the following class in a .js file and I am trying to > create an object of this class, but it is not working. I am getting > undefined instead of the object, when I use the new. I am new to both > node.js and JavaScript.

[nodejs] Objects in node.js

2013-03-11 Thread Venkatesh U
Hi, I have defined the following class in a .js file and I am trying to create an object of this class, but it is not working. I am getting undefined instead of the object, when I use the new. I am new to both node.js and JavaScript. It will be great help to me, if somebody can give some insi