Closed ghost closed 9 years ago
Yeah, Javascript's a little weird this way. There isn't a way to do what you want to do in the way you're doing it.
Instead, try this:
var deckToSave = {}
deckToSave[saveName] = tempDeck;
hmm, now instead of saving the string it seems to be saving the jquery function of "$("#savename").val;"
in the console: function (a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFun ....
Ah figured it out needed the parens'
Thanks very much!
:+1:
I was hoping to add an object (cardDeck) to an array (decksMaster) AS an object(deckToSave) with the key as the variable the user inputs(saveName). However, I think the key is just becoming the string "saveName"?