O que me foi pedido:
- 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.
E o meu código está assim:
var counter = 0;
var incrementCounterBy = function (amount) {
counter++;
};
var resetCounter = function () {
setCounter= 0;
};
Quando tento correr o código recebo o erro:
Code is incorrect Make sure you are incrementing the counter by amount
counter++;
MAS SIMcounter += amount;
.