If I understand your situation, you have a value in the variable called
a, and you want to find that value in the array to remove it.
var a = Math.floor(Math.random()*(cards.length));
First you need to figure out where in the array that the
a value is, and then knowing where it is, you need to remove it from the array.
You can use indexOf() to find out where something is in the array.
var cardPos = cards.indexOf(a); // get the position of a from the cards array.
The array splice() method is used to add/remove things from an array. The first parameter is the index of the array, and the second parameter is how many items to remove. If you wanted to insert items into the array you would use additional parameters to do that.
cards.splice(cardPos, 1); // delete one array item from the cardPos position.
Putting this all together you can do it with just the one statement: