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

Thursday, December 6, 2012

Codecademy: Codeyear One function to rule them all...


//sample solution


function howManyCoins (coinName, coinAmount, coinsSoFar) {
    //fill this in
    if (change < coinAmount) {
console.log (coinsSoFar + " " + coinName);
} else {
change -= coinAmount;
return howManyCoins(coinName, coinAmount, coinsSoFar + 1);
}
}

change = 4.94;
console.log("Give them:");
howManyCoins("dollar bills", 1.00, 0);

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts