Dynamic Array (preset default values)



Dynamic Array (assign default values)
Pas2JS pascal source code
type TA = array of Integer; procedure Test(Data: TA = []); begin Writeln(Length(Data)); end; var a: TA := [1, 2, 3, 4]; begin Test(a); // 4 WriteLn('---'); Test; // 0 Test([1, 5]); // 2 Test([]); // 0