Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between a module and an object

Status
Not open for further replies.

slobad23

IS-IT--Management
Jun 30, 2006
90
0
0
GB
Could someone please explain the difference between these two:

//module
<code>
var a_module = (function() {
var private_variable = "some value";

function private_function() {
//some code
}

return {
public_property: "something"
//etc
}
}());
</code>

Could I not achieve the same thing by using class owned instance methods or class methods?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top