Question: Using this as a starter: (JAVASCRIPT) const cardObject = { _intervalID: null, _counter: 50, _cards: ace,2,3,4,5,6,7,8,9,10,jack,queen,king.split(,), _suits: clubs diamonds hearts spades.split( ), Implement and test
Using this as a starter: (JAVASCRIPT)
const cardObject = { _intervalID: null, _counter: 50, _cards: "ace,2,3,4,5,6,7,8,9,10,jack,queen,king".split(","), _suits: "clubs diamonds hearts spades".split(" "),
Implement and test getRandomCard() method per comments.
Implement and test getRandomSuit() method per comments.
getRandomCard: function() { // TODO [H]: Return a random card value from the cards array // TODO [H]: If card is 0, then use 10 to account for actual image file // Hint: Generate a random array index value for the cards array }, getRandomSuit: function() { // TODO [I]: Return a random suit value from the suits array // Hint: Generate a random array index value for the suits array } };
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
