Here's what I am trying: I have an object and I'm trying increment the values by 0.01 & 1 using setInterval
my object
var data = {
timer: {
"num": "0.1",
"perfection": "0",
}
}
here num
value has to be increased by 0.1 & perfection
value by 1 and if perfection's value reaches 100 then it has to stop using set interval
var data = {
timer: {
"num": "0.0",
"perfection": "0"
}
}
var info = [];
var maxValue=101;
setInterval(loop,2000)
function loop(){
for(var i = 0; i < maxValue; i++) {
data['timer']['perfection'] = i;
console.log(data)
}
}