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

Friday, December 7, 2012

Codecademy: Codeyear By reference, I think you've got it!


//sample solution


//Here is the original card object
var card1 = {"suit":"clubs", "rank": 8};

//Create a variable named card2 and set it equal to card 1
var card2 = card1;
//Change the rank of the card2 variable to 3
card2.rank=3;
//Log the value of the rank property of card 1 to the console
console.log(card1.rank);

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts