Compounds operators with Array



Compounds operators
Pas2JS pascal source code
var d : array of Integer; s : array [0..1] of Float; i,j : Integer; begin d.Add(1, 2); i := 0; j := 1; d[i] += 10; d[j] += 100; s[i] += 10; s[j] += 100; d[i] -= 1; d[j] -= 2; s[i] -= 1; s[j] -= 2; d[i] *= 2; d[j] *= 3; s[i] *= 2; s[j] *= 3; s[i] /= 2; s[j] /= 4; WriteLn(d[0]); // 20 WriteLn(d[1]); // 300 WriteLn('--------------'); WriteLn(s[0]); // 9 WriteLn(s[1]); // 73.5