How to conditionally save information using Array?

 

How to conditionally save information using Array?

Hi everyone, I am currently experimenting conditional Arrays and came across a problem which I need some help solving it. 

How do I store data(information) every time a condition has been met?  

Any help will be much appreciated. 

Thanks in advance. 

// eg: everytime the High of the previous bar is >= 1.025 , store the Time of the previous bar into History array

//  but how do I make it dynamic, store not just one bar, because the condition will/won't be met when new bars are formed.

if (High[1] >= 1.025) {

History[1] = Time[1];

}