I have the code below, as you can see I'm manually specifying the properties I want to return, I don't care about having private/public functions here, so I'd like a quick & dynamic way to just return all functions in the scope. Is this possible? I've tried a few things but having trouble, it has to be done inside the scope otherwise it can't see the functions.
var MyObj = {
(function() {
function MyFuncOne() {}
function MyFuncTwo() {}
return {
MyFuncOne: MyFuncOne,
MyFuncTwo: MyFuncTwo
}
})()
}
var MyObjTwo = {
(function() {
function MyFuncOne() {}
function MyFuncTwo() {}
return {
MyFuncOne: MyFuncOne,
MyFuncTwo: MyFuncTwo
}
})()
}
Pseudo code of what I want:
function ReturnAllProperties() { //foreach func in scope append to list }
then in the return { ReturnAllProperties(); }