I have the following code:
“myFunction” is an anonymous function that I have got as a parameter.
…
newObj = { id: idValue, div: null };
newObj.div = myFunction();
Is there a shorter way, a way to directly assign the result of a function to the object literal, something like:
newObj = { id: idValue, div: (myFunction ())};
Thanks alot in advance
Wolfgang
what you have should work: