Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Declare an object expression cardObject using the following code: const cardObject = { /* TODO [C] : Add the following properties (remember to start properties
Declare an object expression cardObject using the following code:
const cardObject = { /* TODO [C]: Add the following properties (remember to start properties with an underscore): - timer ID property used to stop timer, initialized to null, example: _intervalID: null, - initial counter property starting value - counter property that will count down to zero - cards array initialized using a string and the split() method - suits array initialized using a string and the split() method */ 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 }, loadImages: function() { // TODO [J]: Update img element src attribute with a randomly generated card and suit image file name // Hint: You will need to call getRandomCard() and getRandomSuit() to create image filename }, countDown: function() { // TODO [G]: Decrement and display count down value, and upon reaching 0 stop timer and display card image // Hint: You will need to call displayCountdown(), stopCountDownTimer() and loadImages() },
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started