This is probably too simple, but the object syntax is getting to me.
I have a simple function, that returns a string perfectly fit for using as arguments on an object, so:
function createString() {
// yadda yadda yadda
return myPerfectstring;
}
and then there's this object, which should take myPerfectstring as a value like this:
new myPlayer({
this: "#that",
css: "#theOther"
},
// insert myPerfectstring here
// if I log it to the console and copy-paste here, everything works wonders
, {
other: "nana",
things: "yeah",
around: "yeahyeah"
});
i know i can't just throw the function there, neither store it in a variable and insert, so, how do i go about entering that string as if it were really part of the object?
newPlayeris a function and seems you want to pass three arguments to it. I don't understand the "object" part. Do you wantnew myPlayer({...}, createString(), {...})? What ismyPerfectstring?