Can you tell me more about the
var card = $userCardPlayer.discard
Why should I put an in there and how it fix it?
You seem to be a beginner in javascript, so I would suggest you go follow a tutorial on the language (and notions that are common to all programming languages). You need to learn and be familiar with the basic notions like what's an integer, a float, a Boolean, conditionals, incremental, inheritance, different types of loops, etc.
The problem with the line
var card = $userCardPlayer.discard is that it refers to an array (presumably, that object is not a default object in RPG Maker and I don't know what plugin you are using), and not an element of the array (which is what you want within the loop). Basic the loop that you posted means something like "Okay, I have a group of cards in $userCardPlayer.discard, and I want to go through every card in the group and do a certain operation with every card".
So the correct way of doing the loop would be (with the commentary to help you understand):
Code:
for (var i = 0; i < $userCardPlayer.discard.length; i++) {
// Select the card from the array of cards, hence the [i].
// By making i gain +1 at the end of the loop, it's like you're picking
// the next card in the group and going through the same code.
var card = $userCardPlayer.discard[i];
// Do the operation you want to accomplish with that card for this loop.
// Although I don't know what $userCard refers to. In this example, I don't
// understand the utility of defining card if you won't mention it afterward.
if (card.element().toUpperCase() === 'NONE') {
$userCard.gainLevel(1);
$userCard.gainPower(1);
}
}
EDIT: It's really hard to help you in this particular case since I have no idea what you are trying to accomplish, and I have no idea how the plugin for cards you are using works. I'm just giving explanations in a general way, not specific to this case.