Skip to content

Commit e505b58

Browse files
Singletons can have their own private functions.
1 parent 1e96289 commit e505b58

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

singleton.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
var singleton = function () {
22
var privateVariable;
33

4+
function privateFunction(x) {
5+
/* perhaps do something with privateVariable... */
6+
};
7+
48
return {};
59
}();

0 commit comments

Comments
 (0)