so what is your objective here, define a private method?
anyways, the naming of "child method" and "sibling method" does not really make sense. seen verbatim, every method of an object is a sibling method of the other. "child method" would only make sense if inheritance were involved (which isn’t).
if child method is meant to be that:
testSingleton.myFirstMethod.childMethod();,
myFirstMethod must be an object (and in this particular case not even a function), which has a
childMethod() property. mind that
childMethod() does not have a relation to
testSingleton then.
PHP Code:
var testSingleton = {
myFirstMethod: {
childMethod: function() {}
}
};
// alternately
var testSingleton = {
myFirstMethod: function()
{
return {
childMethod: function() {}
}
}
};
// as
testSingleton.myFirstMethod().childMethod();