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

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -