I am trying to increment a value by one each time but its not working. My variable currentValue
gives me 0
as expected but when i try increment it using var newValue = currentValue ++;
it still gives me 0
.
function updateClicks(e, maxValue) {
var buttonClicked = e.target;
addClass("clicked", buttonClicked);
var counterBox = buttonClicked.nextElementSibling;
var currentValue = buttonClicked.value;
console.log(currentValue);
var newValue = currentValue++;
console.log(newValue);
}
What am I doing wrong here?