How I can create a thing which is both function and object at a same time?
Suppose its name is obj.
In the following context it is a object:
obj.key1 = "abc";
obj.key2 = "xyz";
And in another context it is a function like this:
var test = obj("abc");
How I can create this object in JavaScript?
function test(param) { alert(param); }, you could dotest.prop = 'testProp'