javascript - Using a function as an Object's key -
i have function accepts function parameter i'd use key object...
function foo(func) { return { func: true }; }
this, of course, returns object string 'func' key (not want).
is right solution create string func
, create object?
is there way create hash function?
bearing in mind object keys strings should able use syntax:
result = {}; result[func] = true; return result;
Comments
Post a Comment