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

Monday, December 17, 2012

Codecademy Sample Solution: Codeyear Filling in the Javascript Function



var qty = 0;

function modify_qty(val) {
    var new_qty = qty+val;
    return new_qty;
}

// This should add 12 to qty.
modify_qty(12);

2 comments:

  1. Hey there eeSmith,

    I just tested out the code on codecademy's Javascript terminal and the result is 12. I then modified the initial value of qty to 5 and the result was 17.

    Make sure you press on "Save and Submit" after you paste the code.

    If you're still having problems, just post the steps that you've tried out and I'll try to replicate that.

    Thanks for supporting this site. Hope it continues to be of help to others newbie coders.

    Nathan

    ReplyDelete


This is an example of scrolling text using Javascript.

Popular Posts