Dynamic Array (remove, push methods)



Dynamic Array (remove method)
Pas2JS pascal source code
var a : array of Float; procedure ShowData; begin for var f in a do WriteLn(IntToStr(Length(a))+' : '+FloatToStr(f)); end; begin a.Remove(0.5); ShowData; // 0 : a.Add(1.5); a.Remove(0.5); ShowData; // 1 : 1.5 a.Remove(1.5); ShowData; // 0 : a.Add(1.0, 2.0); a.Remove(1.0, 1); ShowData; // 2 : 1 // 2 : 2 a.Remove(1.0, 0); ShowData; // 1 : 2