Hello, I'm new with node red and programing so please do not destroy me for stupid questions.
In sweat, tears and blo0d I created this:
var count=context.get('count') || 0;
count +=1;
msg.payload=count;
context.set('count',count);
if (count == 3 ) {
count = 0;
}
return msg;
My objective is to recive in the end counter that counts 1,2,3,1,2,3 etc...
Right now I have counter that count from 1 to infinity .... My issue is that im not able to reset this counter after it reaches to some value.
Sorry for beginners question but i'm not so good with programing.
Regards, Kamil.