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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -