Quotes help make search much faster. Example: "Practice Makes Perfect"

Friday, December 7, 2012

Codecademy: Codeyear Another dimension


//sample solution


//use the length method of the array to get the suit of the last card
//in this 2D array
var cards = [ ["A", "hearts"],  [3, "clubs"] ];

//first get the last item in the cards array
var lastCard = cards[1];

//then get the suit (which is the last item) in the lastCard array
var lastSuit = lastCard[1];
//test
console.log(lastSuit);

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts