Refer to the following code snippet and identify the use of theshift()method in the code provided.
?
pokerCard.prototype.replaceFromDeck = function(pokerDeck) {
this.suit = pokerDeck.cards[0].suit;
this.rank = pokerDeck.cards[0].rank;
this.rankValue = pokerDeck.cards[0].rankValue;
pokerDeck.cards.shift();
}

A. To remove the suit, rank, and rankValue from the pokerDeck object
B. To add the suit, rank, and rankValue to the pokerDeck object
C. To add the first card to the cards array in the pokerDeck object
D. To remove the first card from the cards array in the pokerDeck object.


Answer: D

Computer Science & Information Technology

You might also like to view...

The printer you want to use automatically, unless you specify otherwise, is called the ____________________ printer.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Which of the following is NOT a valid value for the border-style property?

a. dashed b. groove c. solid d. triple

Computer Science & Information Technology

A(n) ________ is installed on your computer, and when the program is opened, your e-mail is downloaded to your computer

A) e-mail server B) e-mail host C) e-mail client D) web-based e-mail

Computer Science & Information Technology

The Banker’s Algorithm ________.

a) can provide better resource utilization than deadlock prevention b) incurs little overhead c) is appropriate for real-time systems d) facilitates applications programming

Computer Science & Information Technology