Question: Need help coding the following? Create a new pokerCard object named myStarterCard. Apply the shift() method to the cards array of myDeck to store the

Need help coding the following?

Create a new pokerCard object named myStarterCard. Apply the shift() method to the cards array of myDeck to store the first card from the deck in myStarterCard. Change the srcattribute of the newCard inline image by calling the cardImage() method for the myStarterCard object.

my js:

"use strict";

/*

New Perspectives on HTML5, CSS3, and JavaScript 6th Edition

Tutorial 14

Review Assignment

Author:

Date:

Filename: ag_squares.js

*/

window.addEventListener("load", playPokerSquares);

function playPokerSquares() {

var newCard = document.getElementById("newCard");

var startButton = document.getElementById("startButton");

var rowSumCells = document.querySelectorAll("table#grid th.rowsum");

var colSumCells = document.querySelectorAll("table#grid th.colsum");

var cardImages = document.querySelectorAll("table#grid tr td img");

var gameScore = document.getElementById("gameScore");

var gameResult = document.getElementById("gameResult");

}

// sets up the game

startButton.addEventListener("click", function() {

squareGame.gameTotal = 0;

squareGame.gameScore = "";

squareGame.gameResult = "";

for ( var i =0; i

rowSumCells, colSumCells[i] = '';

}

for ( var i =0; i

}

// method to randomly sort the deck

this.shuffle = function(){

this.cards.sort(function) {

return 0.5 - math.random();

})

// create a new deck of cards and shuffle it

var myDeck = new pockerDeck();

myDeck.shuffle();

console.log(myDeck);

});

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!