I am working with an array and a counter that is synchronized with the elements of the array.
What I am trying to achieve is a specific sequence as follows: When the counter hits x6, the first 5 items should be marked as false. When the counter reaches x11, the first 10 items should be marked as false. This way, only 5 items are set to true at any given time in sequences.
//Sample code snippet in .ts file for reference
//Counter synchronization with the array - saving values accordingly:
this.counter += 1;
let xNum = "x" + this.counter;
this.x[xNum] = true;
//Array containing infinite number of items
public x: any = ["x0", "x1", "x2", "x3", "x4", "x5", "x6",
"x7", "x8", "x9", "x10", "x11", "x12",
"x13", "x14", "x15", "x16", "x17", "x18"...]