var FuncFactory = function (data) {
var f = data.main;
for (var key in data) {
if (data.hasOwnProperty(key) && key != 'main') {
f[key] = data[key];
}
}
return f;
};
var testObj = FuncFactory({
main: function() {
console.log('Test');
},
propetry: 'propetry',
secondTest: function () {
console.log('Test second');
}
});
testObj();
testObj.secondTest();
console.log(testObj.propetry);