1
What was asked of me:
- Declare a global variable called counter and assign it 0.
- Declare a Function called incrementCounterBy, which receives a Parameter called amount. It should increment counter by the amount.
- Declare a Function called resetCounter that should set the counter value back to 0.
- Test your counter and have some fun.
And my code is like this:
var counter = 0;
var incrementCounterBy = function (amount) {
counter++;
};
var resetCounter = function () {
setCounter= 0;
};
When I try to run the code I get the error:
Code is incorrect Make sure you are incrementing the counter by amount
What is asked is not:
counter++;
BUT YEScounter += amount;
.– anonimo
Ahh as n saw it earlier? how frustrating n know to interpret well what is asked! Anyway, thank you very much!
– DIOGO