java script singleton class

0 votes
asked Nov 29, 2012 in java script by jonathan (3,105 points)
hi friends.

   is there any way to create sigleton class in javascript?

1 Answer

0 votes
answered Nov 29, 2012 by anonymous




I think the easiest way is to declare a simple object literal:

function InEvents()



    this.setChangeListener=function(listener)    {

       //do something



var Events=new InEvents();


for more information just refer the below link